Flaky Test
A test that passes and fails on identical input, and the most corrosive thing a suite can contain.
A flaky test fails intermittently on unchanged code. Its real cost is not the failed run but the habit it teaches: once a suite has flakes, every failure gets a rerun before it gets a diagnosis, and real defects ship because they looked like flakes.
Flakes have a small number of causes, and identifying which one is at play is most of the work.
Timing. An assertion racing an asynchronous update. Waiting for a condition rather than a duration fixes it; a fixed sleep only moves it. Ordering. Shared state between tests, so a test passes alone and fails after a sibling. Contention. A timeout that only blows under load, which is Resource Starvation and not a defect at all. Environment. Disk exhaustion, a cold build cache, a development server holding a port. Non-determinism in the system under test — clock, randomness, iteration order.
Two diagnostic rules earn their keep. An identical failure across repeated runs of the same revision is a real gap, not a flake; rerunning cannot make it pass. And a flake at a ten percent rate needs roughly twenty consecutive green runs before "fixed" means anything — one green run proves nothing. See Nondeterminism.
See also7
Hand-picked in the note itself — the neighbours worth reading next.
Race Condition
A defect whose occurrence depends on the relative timing of concurrent operations.
Testing & Verification11 connections
Resource Starvation
Failures caused by competition for a finite shared resource rather than by any defect.
Testing & Verification10 connections
Determinism
The property that identical inputs produce identical outputs, and the foundation of caching and verification.
Systems & Tooling27 connections
Reproducible Case
The smallest set of steps that reliably produces a fault, and the unit of real debugging.
Method17 connections
Bundler
The tool that resolves an application's modules into the files a browser downloads.
Web Platform12 connections
Instrumentation
Adding measurement to code so its execution can be observed, and the distortions that introduces.
Testing & Verification12 connections
Regression
A previously working behaviour that a change has broken.
Method16 connections
Related2
Nearby in the graph rather than deliberately chosen. Looser, sometimes surprising.
Linked from10
Notes elsewhere in the wiki that reach for this one.
- BundlerWeb Platform
The tool that resolves an application's modules into the files a browser downloads.
- Continuous IntegrationVersion Control & Delivery
Automatically building and testing every change, so integration problems surface immediately.
- DeterminismSystems & Tooling
The property that identical inputs produce identical outputs, and the foundation of caching and verification.
- InstrumentationTesting & Verification
Adding measurement to code so its execution can be observed, and the distortions that introduces.
- NondeterminismAgents & Language Models
The property that identical inputs may produce different outputs, and what it costs to test around.
- Race ConditionTesting & Verification
A defect whose occurrence depends on the relative timing of concurrent operations.
- RegressionMethod
A previously working behaviour that a change has broken.
- Reproducible CaseMethod
The smallest set of steps that reliably produces a fault, and the unit of real debugging.
- Resource StarvationTesting & Verification
Failures caused by competition for a finite shared resource rather than by any defect.
- Vacuous TruthMethod
A statement that holds only because its subject set is empty — a green result that measured nothing.