Add workaround for Chrome/Chromedriver issue - #2252
Open
lfdebrux wants to merge 2 commits into
Open
Conversation
Our feature tests using Capybara and Chromedriver are intermittently failing with the following error:
unknown error: unhandled inspector error: {"code":-32000,"message":"Node with given id does not belong to the document"}
This can usually be fixed by rerunning the tests.
In our CI environments and end-to-end tests we pin chrome to 128 where
the issue doesn't occur.
It's harder to pin chrome in local development environments.
This commit takes a different approach found in a comment on the
capabara issue: It adds a monkey patch to the Selenium driver to
intercept the initialization of `UnknownError` and raise a
`StaleElementReferenceError` instead.
This makes the test retry.
This commit can be reverted once the issue is resolved.
teamcapybara/capybara#2800
unknown error: unhandled inspector error: {"code":-32000,"message":"Node with given id does not belong to the document"}
Contributor
|
🎉 A review copy of this PR has been deployed! It is made of up two components It may take 5 minutes or so for the application to be fully deployed and working. If it still isn't ready For the sign in details and more information, see the review apps wiki page. |
Contributor
|
I've just merged a fix in forms-admin based on the most recent update in the Chromedriver issue, I think if that turns out to be stable we can avoid implementing the workaround here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What problem does this pull request solve?
Trello card: https://trello.com/c/bFuui8d7/3458-unpin-alpine-version-in-forms-e2e-tests-once-chromedriver-issue-is-fixed
Capybara issue 2800 has still not been resolved upstream in Chrome, or in Chromedriver, Selenium, or Capybara.
In our tests in GitHub Actions we were pinning Chrome to a version not affected by this, but that version is getting quite old. We would like to stop pinning the version of Chrome.
Instead this PR cherry-picks the Capybara workaround we've used in other repos to make Capybara treat this error as retryable, hopefully preventing the errors from surfacing. This PR then also unpins Chrome in our CI tests.
Things to consider when reviewing