Attempt to fix brittle tests under chrome 132#33
Conversation
Fix concurrent-ruby version to 1.3.4 for older Rails versions
|
I arrived here github searching for "aborted by navigation: loader has changed while resolving nodes" You can find several other people are having this error in such a search (more are prob having it without mentioning the phrase in a github issue?) I started having it this week: I think sometime this week Github upgraded their runners to chomedriver 132, which is part of the repro? While I am also using Rails and capybara, this thread to me is I think about selenium use without ruby being involved. https://groups.google.com/g/chromedriver-users/c/dhan8JFk1r4 I'm thinking it's a problem in chromedriver 132 and/or between chromedriver 132 and selenium specifically? I am not sure how to bring it to the attention of anyone who can do anything about it though -- apparently it doesn't effect everyone universally, but just some of us are unfortunate enough to hit it? it's race-conditiony for me, re-running the CI it will pass eventually, but it is annoying. i don't believe there is anything I can change in my own code to avoid it, the error is occuring to me on an |
|
@jrochkind I have a locally working fix. All our failures were on calls to ActionDispatch::IntegrationTest.class_eval do
# assert_current_path is brittle with Chrome 132 on capybara 3.40.0
# Retry up to 3 times on error
def assert_current_path(path, **options, &optional_filter_block)
failures = 0
begin
super
rescue Selenium::WebDriver::Error::WebDriverError => e
failures += 1
if e.message.start_with?('aborted by navigation: loader has changed ' \
"while resolving nodes\n") && failures <= 3
# puts "Retrying after failure #{failures}: #{e.class} #{e.message}"
retry
end
raise
end
end
end |
|
Thanks @bshand that's clever, makes sense. Have to figure out how to patch that into my own Will slow down our already non-swift CI though! I wish I could find evidence that selenium and/or chromedriver teams were aware of this and interested in a fix. |
This PR attempts to get
ndr_errortests running again (pre-bootstrap 5 upgrades tondr_ui) and identify the cause of the recent brittle tests like the following (https://github.com/NHSDigital/ndr_error/actions/runs/12950940910/job/36217578005?pr=32 on PR #32):[Edit: copied from comment below]
All our failures were on calls to
assert_current_path,and I've written an override method to retry this up to 3 times. I've added the following totest/test_helper.rb: