Defect #42687
closedFix random failures in several system tests with Chrome 133 and later
0%
Description
Since recently, some system tests in Redmine have started to fail randomly. This patch addresses that issue.
Failure: IssuesSystemTest#test_create_issue_with_attachment_when_user_is_not_a_member [test/test_helper.rb:231]: "Issue.count" didn't change by 1, but by 0. Expected: 15 Actual: 14 bin/rails test test/system/issues_test.rb:149 Failure: IssuesSystemTest#test_create_issue_with_attachment [test/test_helper.rb:231]: "Issue.count" didn't change by 1, but by 0. Expected: 15 Actual: 14 bin/rails test test/system/issues_test.rb:134 Failure: IssuesSystemTest#test_update_issue_with_form_update_should_keep_newly_added_attachments [test/system/issues_test.rb:270]: Expected: 3 Actual: 2 ...
These failures appear to have started with Chrome 133 and later. The root cause is that the tests verify outcomes before the tested operations—such as issue creation—are fully completed. This patch adds assertions to ensure the operations are finished before verification.
A similar issue, where tests fail due to the changes in Chrome 133 and later, has been reported here:
https://github.com/teamcapybara/capybara/issues/2800
With this fix and the fix from #42422, I have confirmed that all system tests pass with the latest version of Chrome.
Files
Updated by Erica Den 2 days ago
It sounds like Chrome 133 and later introduced changes that caused tests to fail due to premature verification of operations. Your patch ensures that assertions are in place to confirm operations—like issue creation—are fully completed before verification, resolving the problem.