- All playbooks
- Fix flaky tests from CI history
Fix flaky tests from CI history
Find tests that fail and then pass on the same commit, and fix clear causes in the test itself.
Company examples
How OpenAI used this technique
Read what OpenAI changed and follow the original sources.
Fix flaky tests from CI history
The post suggests that prompt for finding flaky tests. In an earlier Codex change (openai/codex#16825, merged April 2026), an approval-policy test launched a second shell command and could fail on Windows startup timing. The fix keeps the escalation-rejection check, asserts that no turn permissions were granted, and checks the approval decision directly.
- Use it when
- A required check fails, then passes on an identical rerun.
- Before applying it
- Preserve the behavior and assertions being tested. Retries, larger timeouts and skipped tests can hide the underlying failure.
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