Making a flaky end-to-end suite deterministic without hiding failures
Turned a non-deterministic end-to-end suite (25 to 37 failures varying per run) into 302 passing with zero failures (8 pre-existing skips left untouched, and the consumer running), without adding a skip or weakening an assertion, and, in review, empirically proved that three of four proposed production changes were unnecessary.
Context
This is my strongest evidence of methodological rigor and of technical leadership in code review. Anyone can make a flaky suite green by loosening it; the engineering is in refusing to. The constraints I set (no new skips, no weaker asserts, no bigger timeouts) are what forced every fix to be a real root cause.
It also captures a moment I'm proud of: rather than accept production changes that had been made to calm the tests, I proved empirically that most of them weren't needed and protected the production code from being changed to satisfy a test artifact. That is the kind of judgment I want recruiters to see.
Problem
The service's end-to-end suite was non-deterministic: a given run might produce anywhere from 25 to 37 failures, and a different set each time. Because the result was unreliable, CI couldn't be trusted. A red run might mean a real regression or nothing at all, so real regressions could hide in the noise. The suite exercised real dependencies (a real auth provider, a database, a local message broker, and an external sandbox API), any of which could contribute to the instability.
03Constraints
Decision
I treated it as a diagnosis problem with a strict protocol.
05Trade-offs
Impact
07Lessons Learned
Reusable engineering knowledge I carry forward from this: