When Cypress detects a CI rerun, it can now skip the work that already passed and run only what failed, so you get to green faster, burn fewer CI minutes, and record fewer billable test results. Re-runs with few failures can skip 99% or more of the tests that would have re-executed. It works out-of-the-box with common CI providers, and ships with overrides to customize the re-run behavior to your specific needs.
Re-run Optimization is available for all Business plans and higher, and in free trials, as a part of Smart Orchestration.
This post will walk through the highlights for saving time and getting a green build faster.
Why do teams re-execute failed Cypress runs?
We interviewed current Cypress Cloud customers to get this feature right. Most told us they already use tools like flake detection to stay on top of things they can control from the testing side. Generally their test design is not causing flakiness, and in-run, often flake represents real race-condition bugs in the application logic.
Re-runs address instability that’s not at the application layer or the test design layer. A re-run adds information to help you understand the full end-to-end picture, especially if your testing environment itself is not fully stable, which means a single failure could have multiple causes. The re-run helps rule some of those causes out cheaply, before you or your AI systems work on debugging.
For busy teams with large test suites on complicated applications, keeping the test environment stable isn’t always practical, or even necessarily desired. When systems integrate with live devices or depend on third parties, stability itself is part of what a full end-to-end test run is measuring.
Whatever the underlying reason for a failure, if something is blocking a release or an important merge, your priority in that moment is to understand the issue and get unblocked as fast as possible. At those times, re-run optimization makes your re-executions cheaper, faster, and less painful.
How much time is saved with Re-run optimization in Cypress Cloud?
The most time savings come from test-level re-runs, which allows Cypress to cherry-pick individual tests that need to re-run. Based on real production runs from customers who have adopted this technique, the median re-run skips 92% of the original run’s tests, and finishes 9.3 minutes faster than the original run.
The maximum savings we have seen on re-runs are when there are large test suites with small numbers of failures, where 99.8% of the tests that would have re-executed were skipped, and 36 minutes were saved for the test run. This is the pattern you may see if you run long nightly test suites or pre-release tests of live environments that might have deployments or other disruptions during the test execution.
Re-run optimization makes it much faster and more practical to get that extra confidence and confirmation of what’s going on when a build has failed, and avoids the risk of instability leading to the original failures passing on the new run, only for something else to start failing.
Choose spec-level or test-level reruns in Cypress Cloud
You set the granularity once in the Smart Orchestration section of your organization or project settings, and projects can inherit the org default or override it.
When set to run only failed specs, Cypress re-runs every spec that contained a failure on the last run, including the tests in that spec that passed, which is the safer choice if your tests share state inside a spec.
When set to run only failed tests, Cypress re-runs only the tests that didn't pass, plus any that are new or changed since the last run. It requires Cypress 15.21.0 or later (older versions fall back to failed specs). If a test would pass on its own with .only, it will work in a re-run. If not, prefer spec-based retries for your project.
Controlling the re-run behavior in Cypress Cloud
If you re-run before Cloud marks the previous run complete, Cypress plays it safe and runs everything. Keeping your run completion delay short can reduce the window where your CI is ready to rerun a job but Cypress Cloud is still open. But in many cases, you may want to manage the previous run’s status explicitly. Our recently released Run Cancellation API, and Run Completion API give you programmatic control over the run state. Combined with Spec Prioritization and Auto Cancellation.
Turn it on
Re-run optimization is part of Smart Orchestration on Business and Enterprise plans, and it's available during a free trial. Owners and Admins can enable it in organization or project settings. The Re-run optimization docs cover setup for each CI provider.
