- All playbooks
- Slow tests
- Reuse non-isolated workers where the harness already resets state between files
Reuse non-isolated workers where the harness already resets state between files
Worker reuse avoids rebuilding the same module and environment state for every test file.
Company examples
How OpenClaw used this technique
Read what OpenClaw changed and follow the original sources.
Reuse non-isolated workers where the harness already resets state between files
Worker reuse avoids rebuilding the same module and environment state for every test file.
The retained comparison reports the UI shard falling from 120.76 seconds to 71.56 seconds. Source
- Use it when
- A large test shard isolates every file and rebuilds jsdom and module state across hundreds of files.
- Before applying it
- Reuse depends on the shared runner restoring mocks, timers, globals, environment and modules after each file. Shared workers exposed cleanup gaps, such as an inherited home setting, that had to be fixed.
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 playbookType-check with a native checker
- 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
- Read OpenClaw’s playbookSelect only the tests and proofs a change can affect