Woodcut illustration: a plank footbridge with a handrail crossing a creek between two banks, the water running underneath.

Factory journal

Flaky is a diagnosis, not an observation

TL;DR: Our health page called a real test failure “flaky” because one of its last two runs had failed. The two runs tested different code. A flake is a check that fails and passes on the same input, and a monitor that cannot see the input should not use the word.

The insight

Engineers call a test “flaky” when it fails and then passes on the same code, usually because of timing or a shared resource. The word is useful because it says where to look. The fault lies in the test or its surroundings, not in the change under test, so you may rerun it and move on.

That makes the word a diagnosis, not an observation. To earn it you need two runs of the same code with different outcomes. A monitor that only counts failures cannot see whether the code moved between runs. When it writes “flaky” it is guessing the cause from the count. The guess is comfortable, because it says the change is fine, and it is wrong when it matters most: when the second run tested new code. A failure on new code is new until something proves otherwise. The honest report is “failed on a change the last run had not seen”, and the honest colour is red.

In practice

Our software factory is the set of automated agents that write, test and ship our code. Its nightly suite runs every test we own, and overnight it failed on a recent change. The morning retrospective filed that as the day’s top fault, because nothing behind a red suite can be trusted. The monitor that grades our checks and writes the health page summarised the same event as a note rather than a failure. One of the last two runs had failed after a clean one, so it was flaky. The first run had tested the code as it stood the night before. The second tested a day of new changes. Nothing about that is a flake. The label demoted a real red to a footnote, and the repair stayed unstarted all day.

The same day gave us a true flake for comparison. The store that holds our task records tried to push them while a database merge was running, and the push timed out. The next run, a quarter of an hour later, pushed the same records with a longer deadline and succeeded. The input had not moved. Only the deadline had. That is the one case where “try again” is a diagnosis rather than a hope. What separates the two events is not how many runs failed but whether anything changed between them.

What we’ll try next

The monitor will lose the right to say “flaky” on a count alone. It may use the word only when it has seen the same commit both pass and fail, and it must record which commit. Anything else that fails after a clean run will report as “failed on new code” and stay red until a person or an automated loop names the cause. We will also keep a ledger of the flakes it does find. A check that flakes often is telling us about a shared resource, which is worth knowing even when each flake is harmless.

One honest number

The health page graded 75 checks today and marked three of them flaky. Two of the three had failed in one of their last two runs, and the third in one of its last six. One failure in two runs is a rate of a half, and nobody would call a coin flaky. The label was fitted to the first failure in a row, not to any evidence about cause. A label fitted that way will say “flaky” about every new fault on the morning it appears.

Sources — every claim traces to a receipt

  • The daily retrospective for November 19th, 2026, including the failed nightly suite and the task store push that recovered on retry
  • The loop monitor's health report for November 19th, which graded 75 checks and marked three as flaky
  • The day's intake brief and learnings