8.1 How to Quarantine Flaky Tests in Test Health (`/health`)
How to quarantine unstable or under-investigation test cases so they execute but do not fail CI/CD builds.
Coverage You Don’t Want Blocking a Build
Section titled “Coverage You Don’t Want Blocking a Build”When a test case becomes flaky – an in-progress backend feature, a shared environment with real timing noise, a third-party sandbox that’s occasionally slow – deleting it is the wrong move, because you lose its coverage history and have to start from zero once the underlying issue is fixed. Quarantining it instead keeps the case running and collecting telemetry on every execution, while stopping its failures from blocking CI/CD builds or pull requests until someone actively decides it’s healthy again.
Flake Governance for AI Agent Cases
Section titled “Flake Governance for AI Agent Cases”AI agent cases feed the same stability scorecard and auto-quarantine policy as UI cases, but their flake signal is computed differently. A UI case is flagged flaky when Playwright needed a retry within a single run; an agent case has no equivalent within-run retry concept (Repeat Count/pass^k, see Statistical Repeat Evaluations, is a deliberately different, within-run statistic). Instead, an agent case’s flake score is 1 minus its pass rate over its last 10 runs – so a case that alternates pass/fail across recent runs scores high and can cross the same auto-quarantine threshold as a flaky UI case. A case that fails consistently also scores high here (it reads as “recently unreliable” rather than strictly non-deterministic) – if a case is quarantined this way, check whether it is actually broken versus genuinely flaky before re-enabling it.
Run-over-Run Significance
Section titled “Run-over-Run Significance”Every run report shows a “vs Previous” column comparing each case’s outcome to its own previous run, using a two-sided Fisher exact test on the two runs’ pass/trial counts (a repeated case’s actual repeatCount trials, or a single pass/fail observation for a non-repeated case). A small swing – say 4/5 passing then 3/5 – is marked “not significant”: the confidence bounds overlap too much to call it a real change. A large swing – 5/5 then 1/5 – is marked as a REGRESSION (or IMPROVEMENT the other way), with the p-value shown on hover. This exists specifically so a noisy 1-repeat difference doesn’t get chased as a regression, while a genuine reliability drop still gets flagged.
Quarantine Buys Time, It Doesn’t Diagnose
Section titled “Quarantine Buys Time, It Doesn’t Diagnose”Quarantine stops a flaky or broken case from blocking a build – it doesn’t tell you why the case is unreliable. Once something is quarantined, use whichever of the diagnostic playbooks below actually matches the failure shape rather than assuming it’ll fix itself.
- Agent Tool Mismatch Diagnostics — Ranked causes for an agent case failing on tool-call timeouts or argument mismatches.
- LLM Judge Calibration — When an agent case’s instability is really the judge, not the agent.
- UI Selector Drift & Iframe Timing — When a UI case’s instability is a timing race or a real markup change.