Skip to content
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

test: fix flakiness in rerun integration test #4598

Merged
merged 5 commits into from
Oct 7, 2024

Conversation

dbjorge
Copy link
Contributor

@dbjorge dbjorge commented Oct 4, 2024

This addresses some test flakiness in /test/integration/rerun/rerun.js which has caused ~4 e2e test failures in CI builds in the last 3 weeks. It manifests as a timeout because the test uses assertions within callbacks to axe.run without propogating errors to the done callback; this addresses that similarly to other tests using the run callback pattern, which should cause new errors in this test to report the actual assertion failure instead of just timing out.

I wasn't able to locally repro the actual failure, but I think a good guess as to why it's failing flakily is the same issue we saw with other tests doing deep comparison of axe result objects (testEnvironment differing between nearby scans due to windowHeight differences). I addressed that by reusing the test util we added for doing result comparison.

I didn't want to hardcode knowledge of the testEnvironment thing into yet another individual test case, so I also refactored the test utility to move that knowledge into one location with a comment explaining it.

@dbjorge dbjorge requested a review from a team as a code owner October 4, 2024 21:13
locales/ru.json Outdated
@@ -593,7 +593,7 @@
}
},
"is-element-focusable": {
"pass": "Элемент может быть сфокусирован.",
"pass": "Элемент может быть сфокусирован.",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you included this file by accident.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The autoformatter pulled it in on its own

straker
straker previously requested changes Oct 4, 2024
Copy link
Contributor

@straker straker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Need to just remove the locale file and should be good to approve

Comment on lines +717 to +719
// testEnvironment is ignored by default because Chrome's UI animations for the
// "an automated test is controlling this browser" notification can cause
// inconsistencies in windowHeight for otherwise-identical scans.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for adding this comment. I didn't understand why we were ignoring it before 👍

@dbjorge dbjorge dismissed straker’s stale review October 6, 2024 00:04

Merged develop to address extra localization file being pulled in

@dbjorge dbjorge merged commit 154ff6d into develop Oct 7, 2024
22 checks passed
@dbjorge dbjorge deleted the fix-flaky-rerun-test-failure branch October 7, 2024 16:20
straker pushed a commit that referenced this pull request Oct 16, 2024
This addresses some test flakiness in `/test/integration/rerun/rerun.js`
which has caused ~4 e2e test failures in CI builds in the last 3 weeks.
It manifests as a timeout because the test uses assertions within
callbacks to `axe.run` without propogating errors to the `done`
callback; this addresses that similarly to other tests using the run
callback pattern, which should cause new errors in this test to report
the actual assertion failure instead of just timing out.

I wasn't able to locally repro the actual failure, but I think a good
guess as to why it's failing flakily is the same issue we saw with other
tests doing deep comparison of axe result objects (testEnvironment
differing between nearby scans due to windowHeight differences). I
addressed that by reusing the test util we added for doing result
comparison.

I didn't want to hardcode knowledge of the testEnvironment thing into
yet another individual test case, so I also refactored the test utility
to move that knowledge into one location with a comment explaining it.

---------

Co-authored-by: dbjorge <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants