Skip to content
Preptima
hardScenarioMidSeniorLead

Your test suite fails randomly about one run in five. How do you get it under control?

7 min readUpdated 2026-08-15

Answer

Short answer

Quarantine and measure before fixing: keep per-test pass history so you can rank offenders and restore a trustworthy signal, then work the root-cause families one at a time.

Was this answer helpful?

Likely follow-ups

  • Three weeks in, the flake rate is down to one run in fifty. What do you change about the pipeline now?
  • A test only fails when the suite runs in parallel with eight workers. How do you find out why?
  • Who owns a quarantined test, and what stops the quarantine list becoming permanent?
  • How would you tell a genuine intermittent product bug apart from a badly written test, from the failure output alone?

Related questions

Further reading