Skip to content

Commit f9c9c98

Browse files
[test optimization] Fix playwright flakiness (#7746)
1 parent 45651f5 commit f9c9c98

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

integration-tests/playwright/playwright.spec.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -981,6 +981,7 @@ versions.forEach((version) => {
981981
test => test.meta[TEST_NAME] === 'playwright should not retry new tests'
982982
)
983983
assert.strictEqual(newTests.length, NUM_RETRIES_EFD + 1)
984+
newTests.sort((a, b) => (a.meta.start ?? 0) - (b.meta.start ?? 0))
984985
newTests.forEach(test => {
985986
assert.strictEqual(test.meta[TEST_STATUS], 'fail')
986987
assert.strictEqual(test.meta[TEST_IS_NEW], 'true')

packages/datadog-instrumentations/src/playwright.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,7 @@ function testEndHandler ({
406406

407407
// ATR: set _ddHasFailedAllRetries when all auto test retries were exhausted and every attempt failed
408408
if (isFlakyTestRetriesEnabled && !testProperties.attemptToFix && !test._ddIsEfdRetry &&
409+
!(test._ddIsNew || test._ddIsModified) &&
409410
flakyTestRetriesCount != null && flakyTestRetriesCount > 0 &&
410411
testStatuses.length === flakyTestRetriesCount + 1 &&
411412
testStatuses.every(status => status === 'fail')) {

0 commit comments

Comments
 (0)