Cypress Test Retries Missing Suite-Level Cap for CI Resource Control
0 reputation · 18 Jun 2021, 04:49 UTC
Cypress Test Retries Configuration
Cypress provides a retries option in cypress.config.js to set a global retry count, and individual tests can override this via testConfig.retries. However, there is no built-in mechanism to cap the total number of retry attempts across an entire test suite or run.
Constraint Gap
Without a suite-level limit, a single flaky test configured with a high per-test retry count can consume disproportionate CI resources. Each retry executes as a separate test run in reporters and the Cypress Dashboard, inflating pass-rate metrics and duration totals while other tests wait in the parallel execution queue.
Current Workarounds
Teams resort to CI-level timeouts or custom plugins that terminate runs abruptly, but these operate outside Cypress's internal retry logic and risk leaving test state inconsistent. An open GitHub issue (#1389) has requested a maxRetriesPerSuite option, yet as of Cypress 13.x no such constraint exists.
How can a suite-level retry budget be enforced without modifying Cypress core? What metrics distinguish original attempts from retries in existing reporters? Is there a supported plugin interface to intercept retry decisions before a test re-runs?