Flaky tests

Flaky tests lists the tests that passed and failed without the code changing in the last 7, 14, 30 or 90 days, scores how often each one flips its verdict, and lets you quarantine a confirmed flake so its failures stop blocking a build. Open it when a pipeline goes red for no visible reason, or to release tests that have settled down.

Where to find it

Sidebar, group Monitor, entry Flaky tests. The Overview's "flaky tests in the last 30 days" item and the Reports Test stability card also link here. Every member of the project can see the list. Quarantine, release and Release N settled need write access to the project (Member or Administrator).

What it shows

A short explanation, the window buttons 7 days, 14 days, 30 days (the default) and 90 days, and, when at least one quarantined test has settled, the button Release N settled. The window is in the address (/flaky?days=90), so a link keeps it.

Under the header, one line gives the number of flaky tests and the window it covers. When the project limits monitoring to certain repositories, the line also says that this page reads every repository and that Reports, the Overview and the KPI count only the monitored ones.

Empty state

"No flaky tests in the last N days: no test passed on retry, none both passed and failed on one commit, and none went back and forth on a branch."

Test table

ColumnWhat it shows
TestSuite and name, plus badges (below), and under them each branch the test ran on: its failures, runs and flips there. The default branch is marked *.
FlakinessThe score from 0 to 100 as a bar and a number, too few runs, or no runs in window for a quarantined test with no recent results
RunsHow many pass/fail results the test has in the window, every branch
FailsHow many of them failed
FlipsHow many times the verdict changed from one run to the next within each branch, summed
(action)Quarantine, or Release for a quarantined test

Badges:

  • passed on retry ×N: in N runs the test failed and then passed on a retry inside the same run (hover for the most attempts it needed).
  • same-commit conflict: it passed and failed on the same commit.
  • flapping on branch: on that branch's own runs it went back and forth.
  • quarantined (hover for the reason recorded), settled (quarantined, and its recent runs are all green; hover to see whether the default branch or every branch was read), no recent results (quarantined, with no pass or fail in the window).
  • not flaky — broken on branch: quarantined, but in this window it only fails on that branch and passes elsewhere. not flaky in this window: quarantined, and none of the three signals is there.

The bar is green below 40, amber from 40 and red from 70.

Order: quarantined tests first, then by score (an unscored test sorts as 0), then by the number of fails.

Auto-quarantine

The panel above the table shows whether the project's auto-quarantine policy is on and how many tests it holds. Settings opens it. Anyone on the project can read it; members with write access and admins can change it.

Failing on one branch only — not flaky

A second panel lists tests that passed on some branches and only failed on others in the window, with the branches on each side. They are broken on those branches (or by those branches' changes), not flaky, so they are not counted. At most 50 are listed; the panel says when there are more.

Early flake detection

Off until someone turns it on, in the Early flake detection panel under Auto-quarantine (Settings; members with write access and admins). With it on, test selection asks the runner to run every new test (one CoverOps has never seen) and every test whose own file changed several times in the job that introduces it, so a flake shows up in the pull request rather than on main a week later.

  • Runs per test (3 by default, 2–10): total executions of each such test.
  • Cap (20; 1–200): when one change brings more new and changed tests than this — a large refactor, or a runner whose test names CoverOps cannot match so that everything looks new — nothing repeats, and the selection answer says so.
  • Extra time budget (300 s; 10–3600): the quickest tests repeat first while the estimated extra time fits. A known test is priced at its own average duration over 30 days, a new one at the project's median test. The tests left out are named in the answer and in the runner's log, and run once.
  • Which runners repeat. Playwright (with the config wrapped in withRepeats()), Vitest, pytest, JUnit 5 and TestNG run the test N times in the same job. JUnit 5 launches the test again once its class is over (a fresh instance and every lifecycle callback each time) and does not repeat under parallel execution, @TestInstance(PER_CLASS) or @TestMethodOrder(OrderAnnotation); TestNG gives it its own invocationCount and does not repeat a test linked by dependsOnMethods/dependsOnGroups or one that sets invocationCount itself. Jest, Mocha, Cypress, go test and dotnet test run it once and print a line saying so. Each runner's README says how.
  • What it counts as. Every execution is reported as an attempt, as a retry is: a test that passed and failed among its runs is flaky in this run — on this page (badge passed on retry/same-run evidence), in run diagnosis and for auto-quarantine, with nothing else to configure. The test's status is failed when any run failed, so a new flaky test fails the pull request that adds it. The run page shows repeated N×: P passed, F failed → flaky.
  • New tests are known only when the runner sends its test list (candidates): the CLI with --candidates, the GitHub Action and the runner plugins do. pytest finds its new tests itself and adds them within the same cap and budget.
  • A change of the settings is in the audit log as flaky.repeat.update.

How it works

  • Data. Every pass and fail result your test runners recorded in the window: all of them, counted in the database, with no row limit. Results are ordered by their run's start time. A skipped result is neither a pass nor a fail, and neither is a test with no result (coverage arrived, no runner verdict did).
  • Branches. Each result belongs to its run's branch. A run that reported no branch takes the branch of another run of the same commit; a run with neither goes into one "no branch" sequence. Flips are only counted inside one branch's sequence, never between branches.
  • Flaky. A test is flaky when any of these holds in the window:
    • Same run. It failed and then passed on retry inside one run (the runner reports its attempts; see Run detail). Two results of one run that disagree count the same way.
    • Same commit. One commit both passed and failed, on any branch: the code was identical.
    • Flapping on a branch. On one branch it changed verdict and changed back: two flips or more. A single flip is a state change — it broke, or it was fixed — which a commit explains.
  • Not flaky. A test that only ever failed is broken. A test that fails on one branch while passing on others is broken on that branch (it appears in the second panel). A test that broke and was then fixed flipped once.
  • Who is listed. Flaky tests, and every quarantined test.
  • Quarantined tests are always listed. A quarantined test with no pass or fail in the window (renamed, removed or no longer run) is still listed, with the no recent results badge, 0 runs and Release. It is never settled, so Release N settled and a pipeline's release leave it in quarantine; release it by hand if it should block builds again.
  • Score. Flips within branches divided by the gaps within branches (each branch's runs − 1, summed), as a percentage.
    • The score is only given from 5 runs. Below that the row shows too few runs: two runs that disagree would otherwise score 100.
    • A pass on retry or a same-commit conflict is proof rather than inference, so it sets the score to at least 90, and gives a score of 90 even with fewer than 5 runs.
    • A quarantined test that is no longer flaky scores 0.
  • Settled. A quarantined test is settled when its last 5 results (at least 3 of them) on the default branch are all passed, none of them on a retry. The default branch is the repository's (main or master when it does not say). A feature branch that broke the test does not hold its quarantine; a flake that is still there shows on the default branch. With no default-branch result in the window (no branches reported, or only feature branches), the last 5 results on every branch are read instead.
  • Quarantine. A quarantined test still runs and is still scored. CI reads the project's quarantine list and ignores the verdicts of the tests on it, so their failures stop blocking a build. Run diagnosis also labels such a failure Quarantined. When you quarantine, a short reason is stored with it, for example "passed on retry in 2 runs", "passed and failed on the same commit" or "flips 4× over 12 runs on main (score 36)". Quarantine entries are matched by suite and name, as before.
  • Release. Release takes the test off the quarantine list, so its failures can block a build again. Release N settled releases every settled test at once. A pipeline can trigger the same release through the CI interface after a green run; it reads the last 30 days.
  • Auto-quarantine (opt-in). Off until someone turns it on. After each run closes (runs closing together, such as a CI matrix, are judged once), a test that meets either rule in the policy's window is quarantined automatically:
    • Rule 1: its score is at least score (40 by default) over at least runs results (10). A pass on retry or a same-commit conflict counts as 90, as in the score above.
    • Rule 2: it failed and passed in one run, or one commit both passed and failed, at least conflicts times (2; 0 turns the rule off), however few runs it has.
    • The window is 7 days by default (1–90).
    • Never quarantined: a test whose recent results (at least 3 of its last 5, read where release reads them) all failed — it is broken, not flaky, and quarantining it would hide a real failure; a test whose recent results all passed (release would let it out at once); a test a person quarantined.
    • The cap. At most cap tests (10) are auto-quarantined at once. When more new tests qualify in one pass than the cap itself, the pass quarantines none, because that looks like a broken build or environment, and says so once. Otherwise the highest scores go first and the rest wait for room. Tests a person quarantined do not count.
    • Reason, audit, notification. The reason is stored as auto: … (for example auto: 2 same-commit conflicts in 7 d (policy: ≥ 2)); the row shows auto-quarantined. Each quarantine is in the audit log as flaky.test.auto_quarantine, with the policy as the actor; a held-back pass as flaky.policy.blocked; a change of the settings as flaky.policy.update. Channels routed Auto-quarantine on the Notifications panel get a message for each pass that quarantined, released or held back.
    • Release. With Release auto-quarantined tests once they settle on (the default), every pass also releases the auto-quarantined tests that have settled. Tests a person quarantined wait for a person or the pipeline. Turning the policy off releases nothing.
    • Saving the policy switched on runs a pass at once; the message says what it did.
  • One count. Reports, the Overview and the flaky-test KPI count flaky tests with this same detection, over their own window. See Reports.
  • Every repository. This page reads every repository of the project, including those the project does not monitor, because quarantine is project-wide: the quarantine list a pipeline reads applies to every repository's runs, so a flake anywhere has to be visible here to be quarantined or released. Reports, the Overview and the flaky-test KPI keep to the monitored repositories, as all their other figures do (runs without a repository always count), so with a watch list their number can be lower than this page's. Test selection and Impact, the other project-wide pages, do not apply the watch list either.
  • The list loads when you open the page, when you change the window and after each action; it does not refresh on a timer.

What you can do

  • Pick the window: 7 days, 14 days, 30 days or 90 days.
  • Quarantine a test: its failures stop blocking a build. A message confirms it.
  • Release a quarantined test: it goes back into the blocking path.
  • Release N settled: releases every quarantined test that has settled. If none has, you see "Nothing has settled yet".
  • Early flake detection → Settings: turn repeats of new and changed tests on or off, and set runs per test, the cap and the extra time budget.
  • Auto-quarantine → Settings: turn the policy on or off, set its thresholds, window, cap and release, and Save (needs write access to the project; the change is recorded in the audit log).

Limits and good to know

  • The API takes any window from 1 to 365 days (?days=); the screen offers 7, 14, 30 and 90.
  • Tests are matched by suite and name. A renamed test starts a new history.
  • Retries are seen when the runner reports its attempts. Old runner versions do not; their retries still arrive as one final verdict, as before. Which runners report attempts, and how, is in each runner's README.
  • Two reports of the same test name in one run without attempts (for example the same Playwright spec on two browsers) are never read as a retry: a test failing on Firefox and passing on Chromium is not flaky.
  • A runner that reruns a whole spec file in a new process counts the reruns itself. WebdriverIO's specFileRetries (with or without specFileRetriesDeferred) is reported this way: a spec that passes on its rerun is a pass on retry, and the same spec on another browser is never counted as a rerun.
  • Release does not happen by itself on a schedule: it happens when someone presses Release or Release N settled, when your pipeline calls the release, or — for auto-quarantined tests, with the policy on — after a run closes.
  • A channel that was routed every notification before Auto-quarantine existed was given it too; a channel routed a chosen few was not.