- All playbooks
- Use a loopback address for local mock servers
Use a loopback address for local mock servers
Point tests at 127.0.0.1 where resolving localhost is slow.
Company examples
How Stripe used this technique
Read what Stripe changed and follow the original sources.
Use a loopback address for local mock servers
Stripe Python points its tests at 127.0.0.1 for the local mock server on Windows runners, where localhost resolution is slow, and keeps localhost elsewhere.
- Use it when
- Local integration tests repeatedly resolve localhost on a slow platform.
- Before applying it
- Bind the mock server and its clients to the same address, and keep dedicated hostname, IPv6 and DNS tests where the product needs them.
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