Skip to content

Commit c497b67

Browse files
committed
Run with retry support to deal with flaky tests
With this configuration, we expect each test to pass 1 out of 3 tries. If it does, it passes. We can track which tests often are flaky by watching for retries, while also keeping the test suite green.
1 parent ba751a2 commit c497b67

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

cypress.config.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,18 @@ module.exports = defineConfig({
99
viewportWidth: 1800,
1010
numTestsKeptInMemory: 0,
1111
videoCompression: false,
12+
13+
// See: https://docs.cypress.io/app/references/experiments#Experimental-Flake-Detection-Features
14+
retries: {
15+
experimentalStrategy: 'detect-flake-and-pass-on-threshold',
16+
experimentalOptions: {
17+
maxRetries: 2,
18+
passesRequired: 1,
19+
},
20+
21+
openMode: true,
22+
runMode: true,
23+
},
1224
// eslint-disable-next-line no-unused-vars
1325
setupNodeEvents(on, config) {
1426
on('after:spec', (spec, results) => {

0 commit comments

Comments
 (0)