Principle:Cypress io Cypress CI Parallelization
| Knowledge Sources | |
|---|---|
| Domains | CI_CD, Distributed_Systems |
| Last Updated | 2026-02-12 00:00 GMT |
Overview
A cloud-coordinated spec distribution mechanism that dynamically assigns test specifications to CI containers for parallel execution, optimizing total pipeline time.
Description
CI parallelization allows multiple CI containers to share a test suite by claiming specs from a central Cloud API. Instead of each container running the entire suite, the Cloud API distributes specs based on historical timing data, ensuring balanced workloads. Each container claims the next spec to run, executes it, reports results, and claims the next until all specs are complete.
This approach requires three components: a unique CI build ID (--ci-build-id), a record key for authentication, and the --parallel flag. The Cloud API manages spec assignment, tracks completion, and aggregates results across all containers.
Usage
Use this principle when running Cypress tests across multiple CI containers to reduce total pipeline time. Requires Cypress Cloud subscription and --record --parallel flags.
Theoretical Basis
Parallelization Protocol:
Container A: createInstance({ parallel, ciBuildId }) → { spec: "login.cy.ts" }
Container B: createInstance({ parallel, ciBuildId }) → { spec: "dashboard.cy.ts" }
Container A: (completes login) → createInstance() → { spec: "settings.cy.ts" }
Container B: (completes dashboard) → createInstance() → { spec: null } (done)
Smart Orchestration:
- Cloud API tracks historical spec durations
- Assigns longest specs first (bin packing)
- Rebalances if a container is slower