- All playbooks
- Slow tests
- Complete the fixture before its timeout fires
Complete the fixture before its timeout fires
Exercise the event that advances the test, so it stops waiting on the timer that rescues it.
Company examples
How Uber used this technique
Read what Uber changed and follow the original sources.
Complete the fixture before its timeout fires
Cadence integration tests polled the foreign workflow's activity, so the next decision waited for the original activity to time out. The fix completes the original workflow's activity and updates expected event IDs for the extra ActivityStarted event. OPT19 is adapted to an accidental activity timeout.
The author identifies a 10-second wait in each affected test. Source
- Use it when
- Tests regularly spend a fixed interval waiting for an operation the fixture could complete immediately.
- Before applying it
- Confirm the test is about the completion path, keep dedicated timeout tests, and update event histories when completion adds events.
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