-
-
Notifications
You must be signed in to change notification settings - Fork 8.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[rb] Fix add_cause method not being able to process an array of hashes #14433
Conversation
PR Reviewer Guide 🔍
|
PR Code Suggestions ✨
|
@p0deje I updated to exclude firefox after the pipelines failures, because instead of throwing a session error, firefox throws the following error: Selenium::WebDriver::Error::InvalidArgumentError: and unless I set the timeout of the remote server to 1 second, I tried with other options to cause the session error and they throw different types of errors, so I think excluding firefox is the best option on this test Should this be a bug btw? because I was expecting the same error across all the browsers |
So the issue on local Mac and local Firefox is that it doesn't fail and the guard throws an error, I will look into that However, in Edge there is this bug, which I can look into but it seems to be outside of the scope of this PR:
|
Looks like it's failing in the trunk as well, so maybe you could take a look in a separate PR. |
Great, I will do |
There are still some failures in RBE tests. I wonder if you could find a different way to test this w/o relying on binary. Maybe try sending a command that would cause a failure (e.g. find non-existent element)? |
That's a good point, I updated the error type now @p0deje |
Ready for re-review @p0deje |
@aguspe Can you please double-check that the spec actually catches the regression you fixed? It's possible that the backtrace is not coming from the remote in this particular case, so we might need to find a different scenario. I know I suggested it in the first place, but I hoped you'd check that by yourself, though I haven't asked for it explicitly. |
So if we want to have a session-related scenario, we could close the driver earlier, here are 2 screenshots of an example before and after the fix on the same spec locally, I will push my changes now so we do not use the find element and we focus on the session which I think is a better spec Could you re-run the pipeline @p0deje ? |
@p0deje the failing test in firefox seems not to be related to my PR, but I will make another PR fixing the issue and also the Edge one so the pipelines work again, unless you prefer me to fix it on this one |
@p0deje I just updated the test to cause the session error without quitting the driver, this should avoid quitting driver errors |
Updated to use title now, I tested locally still produces the session error |
@aguspe There are still some failures in RBE tests |
@p0deje Tested locally on chrome, switched to window handle, works as expected, hopefully now the only issue left is the existent edge one |
@p0deje now the test is not using any script (I cannot reproduce the error locally), but I'm modifying the session id to cause an error |
User description
Description
This PR adds the backtrace from remote method again, since when an error originating from a remote server was processed, since it is not an array of strings it failed, so we need to convert the hashes into strings
Motivation and Context
A proper error message is needed for debugging purposes, so this bugfix helps our users get that.
This PR fixes #14415
Types of changes
Checklist
PR Type
Bug fix, Tests
Description
backtrace_from_remote
to process and convert backtrace from remote server errors into a readable format.Changes walkthrough 📝
response.rb
Enhance error handling for remote server backtrace
rb/lib/selenium/webdriver/remote/response.rb
backtrace_from_remote
to process backtrace from remoteserver.
add_cause
to handle array backtrace from remote server.response.rbs
Update type signature for new backtrace method
rb/sig/lib/selenium/webdriver/remote/response.rbs
backtrace_from_remote
method.error_spec.rb
Add tests for remote server backtrace handling
rb/spec/integration/selenium/webdriver/error_spec.rb
WebDriverError
is raised with a cause.