- All playbooks
- Slow tests
- Move unit tests to a parallel-by-default framework, gated on ten clean runs
Move unit tests to a parallel-by-default framework, gated on ten clean runs
Migrate serial tests to a framework that runs them in parallel, and ship each package after ten green runs.
How DoorDash used this technique
Read what DoorDash changed and follow the original sources.
Move unit tests to a parallel-by-default framework, gated on ten clean runs
Mostly serialized XCTest runs had stretched DoorDash's iOS CI test step into double-digit minutes. DoorDash migrated its shared iOS packages to Swift Testing, which runs synchronous and asynchronous tests in parallel by default. A Cursor rule made the mechanical edits, and the migration prompt told the agent to run each package's tests with Bazel after every file and fix failures before moving on. A package counted as migrated once its tests passed ten times in a row, which surfaced tests that depended on order, shared state or timing. The unit test step in CI got about 60% faster, and overall builds for shared iOS packages about 40% faster.
The unit test step in CI became roughly 60% faster. Source
This contributed to an average of about 40% faster overall builds for shared iOS packages. Source
- Use it when
- A test step runs mostly serially, and the test framework or a newer one can run the same tests in parallel.
- Before applying it
- Parallel runs expose hidden order, shared-state and timing assumptions; fix each root cause, and leave tests on the old framework where the new one lacks a needed feature.
Company Playbooks
- Read Anthropic’s playbookRun only affected tests
- Read DoorDash’s playbookRun build and test in parallel, sharded across CI agents
- Read Linear’s playbookBenchmark the same job on faster hardware
- Read Mastra’s playbookStarSling runners for the slowest test workflow
- Read OpenAI’s playbookRank CI fixes by the minutes they save
- Read Ramp’s playbookMove a CPU-bound test suite to a faster CPU
- Read Shopify’s playbookLet an agent iterate against one CI metric
- Read Spotify’s playbookBuild arm64 on native arm64 runners
- Read Stripe’s playbookRun only the tests a change can reach
- Read Uber’s playbookBuild the merge-queue speculations most likely to be needed