- All playbooks
- Retry only infrastructure failures
Retry only infrastructure failures
Automatic retries are for a lost machine, not for a test shard that timed out.
Company examples
How Anthropic used this technique
Read what Anthropic changed and follow the original sources.
Retry only infrastructure failures
Bun's automatic retry rules matched every timed-out test shard. The change scopes them to a lost agent, so a shard that times out reports once, with no second run.
Across about 200 recent builds, about 670 automatic retries of timed-out test shards: 465 timed out again and 182 were canceled, which the PR counts as 97% wasted. Source
- Use it when
- CI retries timed-out or erroring jobs automatically, and most retries end the same way the first attempt did.
- Before applying it
- Retries stay on for a lost runner or a process that never started.
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