TOPIC 11/4020 MINNOT STARTED

Flaky tests

Name the main causes of a check that passes and fails by luck: timing, shared data and order, async slips and the environment. Then fix them.

L1–L4 are part of the Pro pass

L0 Explain simply

Analogy: a kitchen scale that cannot make up its mind. You weigh flour and see 200 grams. You weigh the same flour again and see 205. Neither number is wrong by much, but now you trust none of them. You start guessing instead.

can act the same way. The Daily List team has a check that goes red on Monday, green on Tuesday and red again on Wednesday. Nobody changed the app. People begin to say, "Just run it again."

A check like this is a . The danger is not the red days. The danger is that people stop looking at red, and one day the red is real.

Tom's job is to find why the scale wobbles. It might be timing, shared data, the order of checks or the machine itself.

The picture has limits. A scale wobbles for one reason. A check can wobble for several reasons at once.

(SYNTHETIC / TRAINING ONLY: Daily List and every person named in this lesson are invented.)

PLAIN WORDS · 3 in this section
flaky
passing sometimes and failing sometimes with no product change
wobbles
Gives a different answer each time, like a shaky scale.
wobble
move up and down by small amounts

PICTURE IT

The picture is the one the lesson above opens with. The table below shows how each part of it matches the software.

THE REAL JOB Naming why passes and fails by luck, and fixing the cause, not hiding it.

  1. Count the passes
  2. Find the cause
  3. Fix the cause
  4. Quarantine with a date
Count, find the cause, fix, quarantine with a date

HOW THE PICTURE MAPS

How each part of the picture matches the software
In the pictureIn the software
The wobbling scaleA flaky check
Weighing again and againRunning it many times
Dust under the scaleShared data or order
Taking it off the shelf for repairQuarantine with a date

WHERE THIS PICTURE STOPS

  • A scale wobbles for one reason. A check may have several.
  • A scale is checked on its own. A check shares a machine with others.
  • A shelf has no deadline. Quarantine must have one.

HOOK

Count, find the cause, fix, quarantine with a date.

REMEMBER IT THIS WAY

A rule of thumb: if you see this, think that.

If goes red, then green, and nobody changed the app, find the cause before anyone says "just run it again".

What each part of the trick stands for
In the trickWhat it stands for
Red, then green, no changeA check that goes red on Monday and green on Tuesday
Just run it againWhat people begin to say
Find the causeTiming, shared data, the order of checks or the machine

A real bug can also come and go, so do not call a check flaky before you look at the cause.

TELL A FRIEND

A scale that gives different numbers for the same flour is not trusted. A flaky check is the same, and it is fixed by finding what makes it wobble.

OFTEN MIXED UP WITH Waits and timing in automated checks. The waits lesson fixes one cause. This lesson names all the usual causes.

PRACTISE AND KEEP

Sources for this topic — 8 sources
  1. Market practice

    Flaky tests at Google and how we mitigate them (Google Testing Blog, 2016) ↗ — Google (Testing Blog) · Describes flaky tests at Google and the ways the team mitigates them (search excerpt, page not opened)

    Per the search excerpt, flaky results wear down trust because people learn to ignore alarms with a history of false signals; Google can re-run failing tests and mark a test as flaky. Practitioner guidance, not a standard. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  2. Market practice

    Eradicating Non-Determinism in Tests (Martin Fowler) ↗ — Martin Fowler · Names isolation, asynchronous behaviour and quarantine; advises polling or callbacks with a timeout instead of bare sleeps; quarantined tests need a deadline (search excerpt, page not opened)

    Names isolation, asynchronous behaviour and quarantine as ways to handle non-deterministic tests, and advises against bare sleeps in favour of callbacks or polling with a timeout. Practitioner or vendor guidance, not a standard unless stated. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  3. Market practice

    Just Say No to More End-to-End Tests (Google Testing Blog, 2015) ↗ — Google · End-to-end tests are slow and flaky when they dominate; keep them few (search excerpt, page not opened)

    Argues for keeping end-to-end tests few because runtime and flakiness grow when they dominate. Practitioner or vendor guidance, not a standard unless stated. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  4. Market practice

    Using promises (Mozilla developer docs) ↗ — Mozilla · It is easy to forget await, and a promise used as a value gives a type mismatch (search excerpt, page not opened)

    Says it is easy to forget the await keyword and that a promise used as a value gives a type mismatch. Practitioner or vendor guidance, not a standard unless stated. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  5. Market practice

    The Practical Test Pyramid (Martin Fowler site, by Ham Vocke) ↗ — Martin Fowler / Ham Vocke · Many small fast checks, few slow ones (search excerpt, page not opened)

    Explains the test pyramid, sorting tests by size, and the ice-cream cone warning. Practitioner guidance, not a standard. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  6. Market practice

    Waiting strategies (Selenium documentation) ↗ — Selenium project · Fixed waits and implicit waits can make timing unpredictable (search excerpt, page not opened)

    Per the search excerpt, an implicit wait is a session-wide setting for element lookups, an explicit wait polls for one named condition, and mixing the two can cause unpredictable wait times. · Checked 2026-10-18

    Found through a web search; the page was not opened (search excerpt, page not opened). Version: Web page, no edition number. Licence terms were not read, so put it in your own words and do not quote it. Open the page and confirm what it says before relying on any detail.

  7. Market practice

    Retries ↗ — Playwright (Microsoft) · Playwright docs: a test that fails first and passes on retry is categorized flaky. Search excerpt, page not opened.

    A test that fails and then passes on retry is categorized flaky; the run can be set to fail on flaky tests. · Checked 2026-11-06

    Primary source opened and operative text inspected on 6 November 2026. Scope: Complete extracted primary article; examples inspected, not executed. Current live Playwright documentation reflects 1.65 where stated; explicit older examples retain their version. Source inspection is not an execution or compatibility-test claim. See the completed v45 Playwright analysis for source discrepancies and exact reading boundaries.

  8. Market practice

    ISTQB Certified Tester Advanced Level Test Automation Engineering (CTAL-TAE) Syllabus v2.0 ↗ — International Software Testing Qualifications Board (ISTQB) · Section 8.1.1 (printed page 48): test histogram to find fragile tests; machine learning and self-healing of locators reported in the test report; version 2.0 of 2024-05-03, mirror copy of the publisher PDF, version checked against front matter, opened

    Version 2.0 syllabus (3 May 2024), read in full text. Used for the objective ids and levels in chapters 1 to 8, the deployment risks, the verification of the automation solution and the configuration management of testware. Paraphrased, not quoted. · Checked 2026-11-07

    Primary publisher body opened and relevant sections read on 6 November 2026; selected-section reading, not a claim every page or external link was read. See docs/research/v16-testing-automation-literacy-audit-20261106.md for exact sections, version and limitations.

    V52 additionally read actual publisher PDF7 November 2026: version 2.0,3 May 2024 front/introduction and all substantivechapters 1–8/29 learning objectives, throughprintedp 53 and selectedreferences. Not every appendix or cited book. §3.1.5 says interface substitution; Martin’s original calls it Interface Segregation. Preserve the source discrepancy separately. No unrestricted commercial image permission established.

Deepest material on this page: L4 — Standards & sources. Where a topic stops short of implementation depth, that is a deliberate coverage decision, not an oversight — see coverage.