How do you quarantine an automated test that fails intermittently on unchanged code without the quarantine becoming permanent?
answer
- Not a mute button
- Who owns it, and until when?
- Still runs, just gates nothing
- Expiry, cap and a written exit
- Name the behaviour now unguarded
basics
~20 sMove it out of the gating lane but keep it running in a non-blocking one, and record the symptom, a named owner, an expiry date and the behaviour now unguarded. Enforce owner, expiry and a size cap in the build.
solid answer
~50 sQuarantine is a bookkeeping mechanism, not a mute button. The case moves out of the gating lane so it stops blocking merges, but it keeps executing in a non-blocking lane, because its pass and fail history is the only evidence that will later justify returning it or removing it. Every entry carries a record: the case, the date it entered, the observed symptom, a named individual owner rather than a team alias, an expiry date, and an explicit note of which behaviour is now unguarded. An automated check enforces that record - the build fails when an entry has no owner, has passed its expiry, or when the list exceeds a hard cap - so adding an entry costs something. Review at a fixed cadence and allow exactly two exits: repaired and returned, or removed with a written decision about the risk being accepted. Drift is the third exit, and it is the one the policy exists to prevent.
code
pseudocode · 18 linesquarantine_entry:
case: "visit-date field rejects an out-of-range date"
since: 2026-02-11
symptom: "fails about 1 run in 9 on the nightly lane, passes on re-run"
owner: "d.okafor" # a person, never a team alias
expires: 2026-02-25 # 14 days
unguarded: "rejection of a visit date outside the study window"
triage: "suspected case problem; product defect not ruled out"
# runs in the pipeline on every build
for entry in quarantine_list:
fail_build("quarantine entry has no owner") if entry.owner is empty
fail_build("quarantine entry expired") if today > entry.expires
fail_build("quarantine over cap") if count(quarantine_list) > 12
# quarantined cases still execute, in a lane that gates nothing
run(quarantine_list, lane = "non-blocking", record_history = true)go deeper
Know that the response to a case failing unpredictably is neither deleting it nor re-running until green. Be able to say that it is moved out of the gate, written down with an owner, and given a date by which it is resolved.
Explain the mechanics: which lane the case runs in afterwards, what the entry records, and why an automated check on owner, expiry and list size is what makes the policy real rather than aspirational.
Show that you treat quarantine as a transferred risk. Talk about the unguarded behaviour, the triage note separating a case problem from a possible product defect, and the two legitimate exits with a written decision.
Own the incentives. Set the cap and the cadence, argue for the budget against pressure to keep merging, and watch for the failure mode where a strict policy simply pushes people to skip cases in source where nothing can audit them.
## What quarantine is for A case that fails unpredictably on unchanged code poisons a shared signal. Left in the gating lane it blocks unrelated merges, and the team's response is predictable and corrosive: people start re-running until green, and then they start ignoring red runs generally, including the true ones. Quarantine buys the team's attention back by removing one case from the gate. What it must not buy is amnesia. The distinction that matters is between **quarantine** and **switching a case off**. Switching off - a skip marker in the source, a commented-out block, a deleted line - stops the case executing, produces no data, and is visible only to someone reading that file. It has no owner, no date and no exit condition, so it becomes dead code that nobody dares remove because nobody remembers why it is there. Quarantine keeps the case running in a lane that does not block anything, so you accumulate exactly the evidence you will need later: how often it fails, whether it started passing again, whether it began failing consistently, which is a different problem entirely. ## The record A quarantine entry is a small, explicit contract. Six fields carry it: - **The case**, named by the behaviour it checks rather than by a file path. - **The date it entered**, so age is visible without archaeology. - **The observed symptom**, in one line, including where it fails and where it passes. - **A named individual owner.** Not a team alias, not a rotation, not the person on call. Aliases absorb responsibility; a name in a list that someone reviews aloud does not. - **An expiry date**, short enough to be uncomfortable. Two weeks is a common choice; the number matters less than that it exists and is enforced. - **The behaviour now unguarded.** This is the field teams skip and the one that makes the entry honest. Quarantining a case silently withdraws a check; writing down what is no longer verified is what lets someone judge whether that is acceptable. A seventh field is worth adding: a triage note distinguishing "this looks like a problem in the case" from "we have not ruled out a real intermittent defect in the product". Quarantine is legitimate for the first and dangerous for the second, because a genuine product race that only shows up occasionally is precisely the failure you most want to keep looking at. ## Enforcement, or the list only grows A policy nobody enforces is a wish. The mechanism is a check that runs in the pipeline on every build and fails it when an entry has no owner, when today is past an entry's expiry, or when the list exceeds a hard cap. The cap is the part that changes behaviour: once it is reached, nothing new enters quarantine until something leaves it, which converts a private convenience into a shared budget. Pair it with a fixed review cadence where the list is read aloud, oldest first, and each entry gets one of two dispositions. There are exactly two exits. **Repaired and returned** to the gating lane, after the fix has survived enough runs to mean something. Or **removed**, with a written decision recording what risk was accepted, by whom, and whether a compensating check was put anywhere else. If the case was the last thing guarding a behaviour that matters, removal is a decision to cover it another way, not a decision to stop caring. ## What it looks like when it goes wrong A suite over a clinical-trial data capture form had a quarantine list of 27 entries. The oldest had been there for eight months; nobody at the review could say what it had originally checked, because the entry recorded only a case identifier and the word "flaky". Two entries turned out to be the same case, added twice under different identifiers after a rename. One was a real intermittent product defect in how the form persisted a value entered in a locale-dependent format - it had been quarantined because it was inconvenient, and the behaviour it guarded had been unverified in every release since. Introducing a cap of twelve and a fourteen-day expiry drained the list in six weeks, mostly by forcing a decision rather than by anyone doing heroic repair work: nine cases were repaired, six were removed with a recorded rationale, and one became a defect ticket. ## The point an interviewer is testing Anyone can say "quarantine the flaky test". The question is whether you understand that quarantine transfers a risk rather than eliminating it, and whether you will build the small amount of machinery - owner, expiry, cap, review, written exit - that keeps the transfer visible. An empty quarantine list is not automatically good news either; it may simply mean the team is skipping cases in source instead, where no policy can see them.
- What is the practical difference between quarantining a case and marking it skipped in the source?A skip marker stops the case executing, produces no history, carries no owner or date, and is visible only to whoever opens that file - so it decays into dead code. Quarantine keeps the case running in a non-blocking lane, so you build the pass/fail evidence needed to return or remove it, and it sits in a list somebody reviews on a schedule.
- How do you stop the quarantine list from growing every sprint?Give it a hard cap enforced by the build, so nothing new enters until something leaves. Make each entry cost a named owner and an expiry date, review the list oldest-first on a fixed cadence, and require a written disposition rather than silence. The cap is what converts a private convenience into a shared budget.
- When is quarantining a case the wrong response entirely?When the intermittent failure has not been ruled out as a real product defect - an occasional race or a data-dependent bug is exactly the signal you want to keep watching. Quarantine also fails when the case is the only thing guarding a high-risk behaviour: then the entry has to be paired with a compensating check or an accepted, recorded exposure.
Quarantine is a hospital bed, not a morgue: the patient is still monitored, someone is named as responsible, and there is a date by which they are discharged one way or the other.
saying these in an interview costs you the question
- Deletes the case the second time it fails
- Marks it skipped in source with no ticket or owner
- Assigns the entry to a team alias nobody reads
- Stops the case executing, so no history accumulates
- Sets no expiry, so the list only ever grows
- Treats an empty quarantine list as proof of health