Does Cypress run tests in parallel and does it retry failed tests automatically?
No, neither by default: cypress run executes specs one after another, and a failed test is not retried until retries is enabled. Parallelism exists only across machines, through Cypress Cloud with --record --parallel or your own split with a CI matrix and --spec. A retry hides flakiness rather than curing it, so every test that passed on a retry is investigated separately.
Cypress · Running and CI
A test failed on CI and passed on the second attempt. Who reran it, and do specs run in parallel?
The question sounds like one, but both halves are answered "no, not by default". A single cypress run executes specs one after another, and a failed test is not repeated until retries are enabled explicitly. The lesson explains where parallelism comes from, what a retry really does and why it can hide a bug.
How it works
Parallelism. cypress run is one process with one browser: specs run sequentially. Parallelism appears only across machines. There are two ways: Cypress Cloud (--record --parallel, several machines sharing one --ci-build-id, Cloud distributes specs across machines) or your own split: a CI matrix where each job runs its slice of files through --spec, or a plugin such as cypress-split.
Retries. Default is 0. The setting distinguishes runMode (cypress run) from openMode (cypress open). Only the failed test is repeated, together with its beforeEach/afterEach hooks; other tests are untouched.
Where parallelism comes from
Specs in sequence
One process, one browser. It only gets faster if you split specs.
Parallel across jobs
Cloud --parallel or a CI matrix with your own file split.
Example: from a "green" CI to an honest one
A team turned retries on everywhere and a green CI became normal. But a test that fails in every third run stays in the suite for years. Better: a minimum of retries on CI and a separate look at every test that passed on a retry.
// cypress.config.ts
import { defineConfig } from 'cypress';
export default defineConfig({
// retries on CI only, locally we want to see a failure at once
retries: { runMode: 2, openMode: 0 },
e2e: {},
});
// for one known-unstable test (with a ticket link)
it('payment', { retries: { runMode: 3 } }, () => {
// ...
});
# each matrix job takes its own slice
npx cypress run --spec "cypress/e2e/checkout/**"
npx cypress run --spec "cypress/e2e/profile/**"
Limits and alternatives
A retry does not cure the cause: a test that passed on the second attempt is "green" in the report but is a flakiness signal (a race, a state not waited for, shared data). A retry also lengthens the run: a failing test executes up to three times. Cypress Cloud flags such tests as flaky; without Cloud you track them yourself, for example in a reporter's output. In Playwright, workers parallelise tests on one machine and --shard splits across machines; retries are off by default there too.
What it looks like on CI
The simplest self-made parallelism needs no services: a CI matrix where every job gets its own group of specs. The drawback is obvious: groups must be maintained by hand, and one heavy group sets the time of the whole run. That is where a duration-aware split helps, but even a split by folders already gives a visible gain.
# .github/workflows/e2e.yml (shortened)
jobs:
cypress:
runs-on: ubuntu-latest
strategy:
fail-fast: false # one group does not stop the rest
matrix:
group: [checkout, profile, search]
steps:
- uses: actions/checkout@v7
- run: npm ci
- run: npx cypress run --spec "cypress/e2e/${{ matrix.group }}/**"
A separate topic is the retry policy. A practical rule: runMode 1-2, locally 0, and any test that passed only on a retry goes onto a review list. Without such a list retries just hide instability: half a year later half the suite is "green" only thanks to the second attempt, and the run time has quietly grown. Signs that a retry hides a real bug rather than noise: the failure reproduces steadily on the same step, and it depends on data or test order, not on random timing.
Common mistakes
- Believing that several terminals with
cypress rungive parallelism: they share artifacts folders, ports and data, which is a race, not scaling. - Enabling retries for
openMode: failures are hidden locally and the developer misses the problem. - Raising the retry count instead of finding the cause: the test is just flaky more slowly.
Check yourself
A CI job runs cypress run on 40 specs and takes 30 minutes. Will raising retries help?
Answer
No, retries only add time for failed tests. Splitting specs over several machines speeds it up: Cloud with --parallel or a CI matrix with --spec.
A test passed on the second attempt. What do you do with the report?
Answer
Do not treat it as stable: it is a flaky candidate. Look at the cause of the first failure (screenshot, video, network), not just enjoy the green.
--parallel or a CI matrix splitting specs. I enable retries for runMode at 1-2 and review every test that passed on a retry, because a retry hides instability.