-
Notifications
You must be signed in to change notification settings - Fork 360
fix(test-optimization): jest instrumentation applies auto test retries on top of other retry mechanisms #7251
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
base: master
Are you sure you want to change the base?
fix(test-optimization): jest instrumentation applies auto test retries on top of other retry mechanisms #7251
Conversation
…s on top of other retry mechanisms
Overall package sizeSelf size: 4.39 MB Dependency sizes| name | version | self size | total size | |------|---------|-----------|------------| | import-in-the-middle | 2.0.0 | 68.46 kB | 797.03 kB | | dc-polyfill | 0.1.10 | 26.73 kB | 26.73 kB |🤖 This report was automatically generated by heaviest-objects-in-the-universe |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #7251 +/- ##
==========================================
- Coverage 84.87% 84.87% -0.01%
==========================================
Files 532 531 -1
Lines 22654 22651 -3
==========================================
- Hits 19227 19224 -3
Misses 3427 3427 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
BenchmarksBenchmark execution time: 2026-01-15 10:13:41 Comparing candidate commit 13aae60 in PR branch Found 0 performance improvements and 0 performance regressions! Performance is the same for 288 metrics, 32 unstable metrics. |
juan-fernandez
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👏 nice! Only minor comments, otherwise LGTM
| }) | ||
|
|
||
| context('early flake detection', () => { | ||
| it('takes precedence over flaky test retries for new tests', (done) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could we try to make the test async instead of using done? I've been trying to get rid of done
| } | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick
| } | |
| ) | |
| }) |
| eventsPromise | ||
| ]) | ||
| }) | ||
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
should we also check that attempt to fix takes precedence over retries triggered by impacted_tests_enabled: true?
| const isAttemptToFix = this.isTestManagementTestsEnabled && | ||
| this.testManagementTestsForThisSuite?.attemptToFix?.includes(testFullName) | ||
| if ( | ||
| this.isTestManagementTestsEnabled && |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nitpick: this is redundant as it's already a requirement for isAttemptToFix
| this.isTestManagementTestsEnabled && |
What does this PR do?
Introduce an order of priority for applying retry mechanisms:
This change aligns the behavior of the Jest instrumentation with how other tracers do it. It also decreases the number of retries and thus the performance overhead introduced by instrumenting tests with Test Optimization. E.g., before this change, if both EFD and ATR were enabled, a new failing test would be executed 66 times:
(1 execution + 10 EFD retries) * (1 execution + 5 ATR retries). After this change, ATR retries will not be applied anymore and this test is only executed 11 times as expected.Motivation
Working on adding the
@test.final_statustag had unexpected side effects with multiple retry mechanisms being applied.