The trust collapse
The first time a rerun turns a red build green, an engineer learns something corrosive: failures are sometimes noise. After that, every genuine failure competes with the hypothesis that it is just flakiness — and the suite has stopped being a signal. Recovering that trust costs far more than preventing the loss.
The four usual causes
Shared mutable test data across parallel specs. Implicit timing waits standing in for proper synchronisation. Dependence on third-party sandboxes with their own availability problems. Assertions coupled to implementation details that change for legitimate reasons. In our experience these account for the overwhelming majority of instability.
Measure it, then quarantine
Track flake rate as a first-class metric per spec. Anything above threshold gets quarantined out of the merge gate immediately — with a ticket, an owner and a deadline, not a permanent skip. A smaller suite everyone trusts beats a comprehensive suite everyone reruns.
The structural fixes
Per-test data factories with unique identifiers. Explicit waits on application state rather than elapsed time. Contract tests and local stubs instead of live third-party calls. Assertions on user-visible behaviour. Test isolation is an architectural property, not a discipline problem.