Skip to content

Commit 3ffe266

Browse files
[test optimization] Improve flakiness in cypress (even more) (#6772)
1 parent c0874b3 commit 3ffe266

File tree

4 files changed

+18
-18
lines changed

4 files changed

+18
-18
lines changed

integration-tests/ci-visibility/subproject/cypress-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"pluginsFile": "cypress/plugins-old/index.js",
55
"supportFile": "cypress/support/e2e.js",
66
"integrationFolder": "cypress/e2e",
7-
"defaultCommandTimeout": 100,
7+
"defaultCommandTimeout": 1000,
88
"nodeVersion": "system"
99
}

integration-tests/ci-visibility/subproject/cypress.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict'
22

33
module.exports = {
4-
defaultCommandTimeout: 100,
4+
defaultCommandTimeout: 1000,
55
e2e: {
66
setupNodeEvents (on, config) {
77
return require('dd-trace/ci/cypress/plugin')(on, config)

integration-tests/cypress-config.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@
44
"pluginsFile": "cypress/plugins-old/index.js",
55
"supportFile": "cypress/support/e2e.js",
66
"integrationFolder": "cypress/e2e",
7-
"defaultCommandTimeout": 100,
7+
"defaultCommandTimeout": 1000,
88
"nodeVersion": "system"
99
}

integration-tests/cypress/cypress.spec.js

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ moduleTypes.forEach(({
493493
.map(file => file.filename)
494494

495495
assert.includeMembers(fileNames, Object.keys(coverageFixture))
496-
}, 20000)
496+
}, 25000)
497497

498498
childProcess = exec(
499499
testCommand,
@@ -988,7 +988,7 @@ moduleTypes.forEach(({
988988
'ci-visibility/subproject/src/index.tsx',
989989
'ci-visibility/subproject/cypress/e2e/spec.cy.js'
990990
])
991-
}, 10000)
991+
}, 25000)
992992

993993
childProcess = exec(
994994
command,
@@ -1028,7 +1028,7 @@ moduleTypes.forEach(({
10281028
assert.exists(testEvent.content.test_session_id)
10291029
assert.notEqual(testEvent.content.test_suite_id, testModuleEvent.content.test_module_id)
10301030
})
1031-
})
1031+
}, 25000)
10321032

10331033
childProcess = exec(
10341034
testCommand,
@@ -1173,7 +1173,7 @@ moduleTypes.forEach(({
11731173

11741174
const testSession = events.find(event => event.type === 'test_session_end').content
11751175
assert.propertyVal(testSession.meta, TEST_EARLY_FLAKE_ENABLED, 'true')
1176-
})
1176+
}, 25000)
11771177

11781178
const {
11791179
NODE_OPTIONS, // NODE_OPTIONS dd-trace config does not work with cypress
@@ -1241,7 +1241,7 @@ moduleTypes.forEach(({
12411241

12421242
const testSession = events.find(event => event.type === 'test_session_end').content
12431243
assert.notProperty(testSession.meta, TEST_EARLY_FLAKE_ENABLED)
1244-
})
1244+
}, 25000)
12451245

12461246
const specToRun = 'cypress/e2e/spec.cy.js'
12471247
childProcess = exec(
@@ -1298,7 +1298,7 @@ moduleTypes.forEach(({
12981298

12991299
const testSession = events.find(event => event.type === 'test_session_end').content
13001300
assert.propertyVal(testSession.meta, TEST_EARLY_FLAKE_ENABLED, 'true')
1301-
})
1301+
}, 25000)
13021302

13031303
const specToRun = 'cypress/e2e/skipped-test.js'
13041304

@@ -1353,7 +1353,7 @@ moduleTypes.forEach(({
13531353

13541354
const newTests = tests.filter(test => test.meta[TEST_IS_NEW] === 'true')
13551355
assert.equal(newTests.length, 0)
1356-
})
1356+
}, 25000)
13571357

13581358
const specToRun = 'cypress/e2e/spec.cy.js'
13591359

@@ -1624,7 +1624,7 @@ moduleTypes.forEach(({
16241624
'cypress/e2e/flaky-test-retries.js.flaky test retry always passes'
16251625
])
16261626
assert.equal(tests.filter(test => test.meta[TEST_RETRY_REASON] === TEST_RETRY_REASON_TYPES.atr).length, 0)
1627-
})
1627+
}, 25000)
16281628

16291629
const {
16301630
NODE_OPTIONS, // NODE_OPTIONS dd-trace config does not work with cypress
@@ -1683,7 +1683,7 @@ moduleTypes.forEach(({
16831683
])
16841684

16851685
assert.equal(tests.filter(test => test.meta[TEST_RETRY_REASON] === TEST_RETRY_REASON_TYPES.atr).length, 2)
1686-
})
1686+
}, 25000)
16871687

16881688
const {
16891689
NODE_OPTIONS, // NODE_OPTIONS dd-trace config does not work with cypress
@@ -1795,7 +1795,7 @@ moduleTypes.forEach(({
17951795

17961796
const testSession = events.find(event => event.type === 'test_session_end').content
17971797
assert.notProperty(testSession.meta, TEST_EARLY_FLAKE_ENABLED)
1798-
})
1798+
}, 25000)
17991799

18001800
const specToRun = 'cypress/e2e/spec.cy.js'
18011801
childProcess = exec(
@@ -1835,7 +1835,7 @@ moduleTypes.forEach(({
18351835
const test = events.find(event => event.type === 'test').content
18361836
assert.equal(test.resource, 'cypress/e2e/multi-origin.js.tests multiple origins')
18371837
assert.equal(test.meta[TEST_STATUS], 'pass')
1838-
})
1838+
}, 25000)
18391839

18401840
secondWebAppServer = http.createServer((req, res) => {
18411841
res.setHeader('Content-Type', 'text/html')
@@ -2011,7 +2011,7 @@ moduleTypes.forEach(({
20112011
}
20122012
}
20132013
}
2014-
})
2014+
}, 25000)
20152015

20162016
const runAttemptToFixTest = async ({
20172017
isAttemptToFix,
@@ -2195,7 +2195,7 @@ moduleTypes.forEach(({
21952195
assert.propertyVal(failedTest.meta, TEST_STATUS, 'fail')
21962196
assert.notProperty(failedTest.meta, TEST_MANAGEMENT_IS_DISABLED)
21972197
}
2198-
})
2198+
}, 25000)
21992199

22002200
const runDisableTest = async (isDisabling, extraEnvVars = {}) => {
22012201
const testAssertionsPromise = getTestAssertions(isDisabling)
@@ -2294,7 +2294,7 @@ moduleTypes.forEach(({
22942294
assert.propertyVal(failedTest.meta, TEST_STATUS, 'fail')
22952295
assert.notProperty(failedTest.meta, TEST_MANAGEMENT_IS_QUARANTINED)
22962296
}
2297-
})
2297+
}, 25000)
22982298

22992299
const runQuarantineTest = async (isQuarantining, extraEnvVars = {}) => {
23002300
const testAssertionsPromise = getTestAssertions(isQuarantining)
@@ -2366,7 +2366,7 @@ moduleTypes.forEach(({
23662366
const tests = events.filter(event => event.type === 'test').map(event => event.content)
23672367
// it is not retried
23682368
assert.equal(tests.length, 1)
2369-
})
2369+
}, 25000)
23702370

23712371
const {
23722372
NODE_OPTIONS,

0 commit comments

Comments
 (0)