Cypress · Browser testing end to end
How does parallel test execution work in Cypress?
Short answer
Cypress parallelization splits spec files across machines or CI jobs. Cypress Cloud can balance them by recorded timings; open-source alternatives use spec splitting or a self-hosted orchestration service.
Parallelization distributes spec files across multiple machines so the wall-clock time drops. Tests inside a single spec still run in order, so the unit of distribution is the spec file, not the individual test. That matters when one spec is much slower than the others.
npx cypress run --record --key <record-key> --parallel
npx cypress run --spec "cypress/e2e/**/*.cy.ts"Balancing strategies
- Cypress Cloud balances by previous spec durations when runs are recorded
- Self-hosted services such as sorry-cypress can coordinate parallel runs
- Spec-splitting plugins divide specs by count or by previous timings without a service
- A plain CI matrix can shard by file list, but balancing is manual
- Shorter, focused specs parallelise better than one enormous spec
Parallel runs need isolated state. If two machines share a database and create the same user, they will collide. Use per-worker data, unique identifiers, or separate backend namespaces. Authenticated sessions and fixtures must not assume a single machine.
Follow-ups you should expect
Interviewers use these to check whether the first answer was understanding or memorisation.
- 1What is the unit of parallelization in Cypress?
- 2How do parallel workers avoid sharing test data?
- 3What does Cypress Cloud add to parallel runs?
- 4Why can too many workers be slower?
Say it in the interview
Cypress parallelization splits spec files across machines, because tests inside a spec still run in order. Cypress Cloud balances by recorded timings, and open-source options use a self-hosted service or a splitting plugin. I make sure the backend state is isolated per worker, otherwise parallel runs collide on the same data. I also measure, because adding workers can cost more than it saves.
Use this as a model, not a script. Saying it in your own words is what makes it survive follow-up pressure.
Related questions
Reading is step one
Now say it out loud.
Understanding an answer and delivering it under pressure are different skills. Rehearse this topic in a live Cypress mock interview and get scored feedback on depth, clarity and confidence.