gezel Gezel Handboek

Fix a Flaky Test

Hunt down an intermittently failing test and make it deterministic: reproduce the flake with real recorded runs, isolate the nondeterminism mechanism, remove it at the real site — never by deleting, skipping, or retrying the test — and prove stability with three consecutive green runs.

How it runs

#StepWho runs itWhat happens
1Reproduce the flake with recorded runsDeveloperRun the suite repeatedly until the intermittent failure is a recorded fact, and characterize when it appears.
2Isolate the mechanismResearcherPin the nondeterminism with a targeted experiment and name the defect site. No fixes yet.
3Remove the nondeterminismDeveloperMake the outcome deterministic at the real site — isolation, cleanup, awaits, seeding — never masking.
4Prove stabilityDeveloperThree consecutive green suite runs, read from real receipts — one green run means nothing for a flake.
5Evaluate the deliverableReviewerIndependently grade the observable deliverable and route it to finish, repair, or user escalation.
6Repair the deliverableDeveloperFix only the concrete gaps from the latest independent review.
7FinishDeveloperAll deterministic and reviewer criteria passed.
8Escalate unresolved concernsDeveloperThe bounded repair loop ended without a defensible pass.

Say something like "fix this flaky test" or "deflake" or "test fails intermittently" or "fails in CI but passes locally" or "intermittent test failure" in chat to start it.

Watch this article as a slideshow