Retries and flaky tests
Use Playwright retries to learn which tests are flaky and to gather evidence, without letting them hide the problem or become the cure.
L1–L4 are part of the Pro pass
L0 Explain simply
Analogy: re-reading a smudged number before deciding it is wrong. A shop bill has a smudge. You read a total that looks too high. You do not shout at once. You look again, and now you read it right. The first reading was the problem, not the bill.
Daily List is a to-do list app. Tom's test for the reminder time fails on Monday. On Tuesday it passes, and nothing in the code changed. Nobody knows what to believe.
The picture has limits. Re-reading a number costs nothing. A retry costs time. If you re-read every time, you may never notice that the smudge is real.
What it is: Playwright is a free library from Microsoft that drives a real browser from code. This topic is one slice of that library: what happens after a test fails. A is an automatic second run, set with retries: 2 or --retries=2. A means the test failed first and passed on a retry. The retry count is testInfo.retry. The first run is 0. The first retry is 1. The nearest neighbour is expect(locator).toBeVisible(), which keeps checking inside one run. A test retry starts the whole test again, in a new worker.
Why it matters: A trains the team to ignore failures. Mei starts treating red as noise, and a real bug hides in the noise. Retries with a clear flaky group help her separate a race from a broken page. They are evidence. They are not the cure. A page that fails one time in three is still broken for Lily.
(SYNTHETIC / TRAINING ONLY: Daily List, the site daily-list.example and every person named in this lesson are invented.)
PLAIN WORDS · 6 in this section
- smudged
- rubbed so that it is hard to read
- smudge
- a small dirty mark
- retry
- trying the same action again after it failed
- playwright
- a free Microsoft tool that drives a browser for tests
- flaky
- passing sometimes and failing sometimes with no product change
- retries
- tries again after a failure, or those further attempts
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 Looking again at a result that looks wrong, to learn if the result or the reading was at fault, without ignoring a real fault.
- Fail the first time
- Retry
- Mark it flaky
- Find the cause
HOW THE PICTURE MAPS
| In the picture | In the software |
|---|---|
| The smudged number | A failed first attempt |
| Reading it again | A test retry |
| It reads fine this time | A flaky result |
| Asking why it smudged | Finding the cause |
WHERE THIS PICTURE STOPS
- Re-reading a number costs nothing. A retry costs time.
- A smudge is outside the bill. A flake can be in the page.
- If only the eventual pass is reported, repeated attempts can hide an intermittent error; retain the failed attempt and flaky result.
HOOK
Read again, then find the smudge.
REMEMBER IT THIS WAY
A rule of thumb: if you see this, think that.
If a test passes on a retry, usually treat it as a flaky warning, not a win. Find the smudge before you trust the green.
| In the trick | What it stands for |
|---|---|
| retry | run the failed test again |
| flaky | passed and failed on the same code |
A flake can be a real bug in the page, so a retry can hide it.
TELL A FRIEND
A smudged number on a bill. You read it again, and then you ask why it smudged.
OFTEN MIXED UP WITH Flaky tests. The flaky tests lesson explains what a is. This lesson shows what Playwright does about one.
Sources & standards — 6 sources
- Market practice
Retries (Playwright documentation) ↗ — Microsoft · retries re-run a failed test; results are passed, flaky or failed; testInfo.retry is 0 on the first run; retries are off by default (search excerpt, page not opened)
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.
- Market practice
Flaky tests at Google and how we mitigate them (Google Testing Blog, 2016) ↗ — Google (Testing Blog) · Flaky tests at Google and how they are managed: a flaky test passes and fails on the same code (search excerpt, page not opened)
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.
- Market practice
Auto-waiting (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: Complete extracted primary article; examples inspected, not executed. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
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.
- Market practice
ISTQB Certified Tester Foundation Level Syllabus v4.0.1 ↗ — International Software Testing Qualifications Board · Section 6.2, Benefits and Risks of Test Automation: a tool needs ongoing effort to give lasting benefits, and its risks need analysis and mitigation (confirmed against the syllabus, read in full text from a mirror copy of the publisher PDF, v4.0.1, 15 September 2024)
v4.0.1 is dated 15 September 2024 and is a list of corrections to v4.0 (21 April 2023) that reworded six learning objectives — not a cosmetic reissue. 78 pages.
Two traps this entry exists to stop. v4.0.2 is the German edition (1 March 2025, 94 pages), so sorting by version number reaches the wrong document. And the widely-repeated per-chapter question allocation "8 / 5 / 4 / 11 / 9 / 3" is wrong: it is 8 / 6 / 4 / 11 / 9 / 2, derived from three official sample-exam answer keys and confirmed against the Exam Structure Tables.
The single most consequential detail for a question bank: white-box coverage — statement and branch — is K2 "Explain", not K3 "Apply" (FL-4.3.1, FL-4.3.2, FL-4.3.3), and MC/DC, path and condition coverage are declared out of scope in §4.3. A question asking a candidate to compute branch coverage is testing something this syllabus does not.
Read through a mirror, because the publisher's own domain could not be fetched (a reachability gap, not a statement about the publisher). A 403 there is a policy refusal and says nothing about whether the document exists or is reachable elsewhere.
Anyone on an unrestricted network should open the canonical URL above and confirm the section and page numbers cited against it. Every claim drawn from this entry is written so that it can be checked against a numbered page.
Read from two independent PDF-to-markdown conversions mirrored on raw.githubusercontent.com. They are treated as faithful because they were produced by unrelated parties with different tooling, agree on the full 64-item objective set including wording, and reproduce the same internal inconsistency present in the source PDF. Chapter 1 reads "testware that supports" where Appendix B reads "that support". A conversion artefact does not replicate across two toolchains.
The licence permits attributed non-commercial extracts and use as the basis for articles. Whether a site that sells a pass may rely on that is an owner's decision, not this entry's.
7 November 2026 review: actual publisher PDF 4.0.1, 15 September 2024, 78 pages, front matter/copyright and relevant numbered operative sections 0.5–0.10 and chapters 1–6 compared with CTFLpractice lessons. Earlier mirror/search descriptions are historical access records. TheK2 white-box objectives require explanation; the source does not justify a categorical ban on small numeric illustrations that support explanation. Later Exam Rules 1.2§4.1.4 usesK2 for keyword definitions, while syllabus§0.5 usesK1; keep dated scopes distinct. No copied questions or figure assets.
- Market practice
Retries ↗ — Playwright (Microsoft) · Reviewed 6 November 2026: Complete extracted primary article; examples inspected, not executed. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
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.
- Market practice
TestOptions (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: trace/video attempt retention. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
Primary source opened and operative text inspected on 6 November 2026. Scope: trace/video attempt retention. 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.
PRACTISE AND KEEP
Sources for this topic — 7 sources
- Market practice
Retries (Playwright documentation) ↗ — Microsoft · retries re-run a failed test; results are passed, flaky or failed; testInfo.retry is 0 on the first run; retries are off by default (search excerpt, page not opened)
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.
- Market practice
Flaky tests at Google and how we mitigate them (Google Testing Blog, 2016) ↗ — Google (Testing Blog) · Flaky tests at Google and how they are managed: a flaky test passes and fails on the same code (search excerpt, page not opened)
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.
- Market practice
Auto-waiting (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: Complete extracted primary article; examples inspected, not executed. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
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.
- Market practice
ISTQB Certified Tester Foundation Level Syllabus v4.0.1 ↗ — International Software Testing Qualifications Board · Section 6.2, Benefits and Risks of Test Automation: a tool needs ongoing effort to give lasting benefits, and its risks need analysis and mitigation (confirmed against the syllabus, read in full text from a mirror copy of the publisher PDF, v4.0.1, 15 September 2024)
v4.0.1 is dated 15 September 2024 and is a list of corrections to v4.0 (21 April 2023) that reworded six learning objectives — not a cosmetic reissue. 78 pages.
Two traps this entry exists to stop. v4.0.2 is the German edition (1 March 2025, 94 pages), so sorting by version number reaches the wrong document. And the widely-repeated per-chapter question allocation "8 / 5 / 4 / 11 / 9 / 3" is wrong: it is 8 / 6 / 4 / 11 / 9 / 2, derived from three official sample-exam answer keys and confirmed against the Exam Structure Tables.
The single most consequential detail for a question bank: white-box coverage — statement and branch — is K2 "Explain", not K3 "Apply" (FL-4.3.1, FL-4.3.2, FL-4.3.3), and MC/DC, path and condition coverage are declared out of scope in §4.3. A question asking a candidate to compute branch coverage is testing something this syllabus does not.
Read through a mirror, because the publisher's own domain could not be fetched (a reachability gap, not a statement about the publisher). A 403 there is a policy refusal and says nothing about whether the document exists or is reachable elsewhere.
Anyone on an unrestricted network should open the canonical URL above and confirm the section and page numbers cited against it. Every claim drawn from this entry is written so that it can be checked against a numbered page.
Read from two independent PDF-to-markdown conversions mirrored on raw.githubusercontent.com. They are treated as faithful because they were produced by unrelated parties with different tooling, agree on the full 64-item objective set including wording, and reproduce the same internal inconsistency present in the source PDF. Chapter 1 reads "testware that supports" where Appendix B reads "that support". A conversion artefact does not replicate across two toolchains.
The licence permits attributed non-commercial extracts and use as the basis for articles. Whether a site that sells a pass may rely on that is an owner's decision, not this entry's.
7 November 2026 review: actual publisher PDF 4.0.1, 15 September 2024, 78 pages, front matter/copyright and relevant numbered operative sections 0.5–0.10 and chapters 1–6 compared with CTFLpractice lessons. Earlier mirror/search descriptions are historical access records. TheK2 white-box objectives require explanation; the source does not justify a categorical ban on small numeric illustrations that support explanation. Later Exam Rules 1.2§4.1.4 usesK2 for keyword definitions, while syllabus§0.5 usesK1; keep dated scopes distinct. No copied questions or figure assets.
- Market practice
Trace viewer: recording a trace ↗ — Microsoft / Playwright project · on-first-retry records the first retry, not the initial failed attempt or second retry. The --trace on command enables recording for a diagnostic run. (primary page opened and read, 2026-10-21)
Primary page opened and read on 2026-10-21. Scope is the claim described here; this does not upgrade earlier citations to other pages. Examples in Daily List are synthetic teaching examples.
- Market practice
Retries ↗ — Playwright (Microsoft) · Reviewed 6 November 2026: Complete extracted primary article; examples inspected, not executed. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
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.
- Market practice
TestOptions (Playwright documentation) ↗ — Microsoft (Playwright) · Reviewed 6 November 2026: trace/video attempt retention. See v45 source analysis for version scope and documented source ambiguities; no upstream run claimed.
Primary source opened and operative text inspected on 6 November 2026. Scope: trace/video attempt retention. 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.
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.