From b5baeadea286ffe6b6c6614324523d82aa711471 Mon Sep 17 00:00:00 2001 From: Copilot <223556219+Copilot@users.noreply.github.com> Date: Thu, 16 Jul 2026 07:16:43 +0000 Subject: [PATCH 1/3] test(firefox): fixme flaky "should create userDataDir" on macOS MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `should create userDataDir if it does not exist` intermittently hits the 30s test timeout while launching the persistent context, but only on the hosted macOS firefox runner under CI load. It fails on no other browser or OS. Repeated local runs on macOS (80x via --repeat-each) never reproduce it, so it is scoped to a fixme keyed to firefox on the current OS rather than a blind fix, and still runs everywhere else. Evidence (firefox-macos-15-large): 30/91 runs failed (33%), error is a bare "Test timeout of 30000ms exceeded." Consistently green on every chromium, webkit and firefox-linux bot. Run history (firefox-macos-15-large): [🟩](https://github.com/microsoft/playwright/actions/runs/28866308287/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/28873490820/attempts/1)[🟥](https://github.com/microsoft/playwright/actions/runs/28875446309/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/28890081894/attempts/1)[🟥](https://github.com/microsoft/playwright/actions/runs/28890567394/attempts/1)[🟧](https://github.com/microsoft/playwright/actions/runs/28902894453/attempts/1)[🟥](https://github.com/microsoft/playwright/actions/runs/28938794208/attempts/1)[🟥](https://github.com/microsoft/playwright/actions/runs/28956057852/attempts/1)[🟥](https://github.com/microsoft/playwright/actions/runs/28965711826/attempts/1)[🟥](https://github.com/microsoft/playwright/actions/runs/29048400472/attempts/1)[🟥](https://github.com/microsoft/playwright/actions/runs/29097158670/attempts/1)[🟥](https://github.com/microsoft/playwright/actions/runs/29109943209/attempts/1)[🟥](https://github.com/microsoft/playwright/actions/runs/29259263344/attempts/1)[🟥](https://github.com/microsoft/playwright/actions/runs/29312025613/attempts/1)[🟥](https://github.com/microsoft/playwright/actions/runs/29361876195/attempts/1)[🟥](https://github.com/microsoft/playwright/actions/runs/29394850590/attempts/1)[🟥](https://github.com/microsoft/playwright/actions/runs/29449506755/attempts/1)[🟥](https://github.com/microsoft/playwright/actions/runs/29461343212/attempts/1) Verified locally on macOS: fixme skips the test on firefox and it still runs (and passes) on chromium; `npm run flint` is green. Generated by: https://github.com/microsoft/playwright/actions/runs/29478806034 Suggested-reviewer: yurys --- tests/library/defaultbrowsercontext-2.spec.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/library/defaultbrowsercontext-2.spec.ts b/tests/library/defaultbrowsercontext-2.spec.ts index 823ad6492769a..14345e0457b2b 100644 --- a/tests/library/defaultbrowsercontext-2.spec.ts +++ b/tests/library/defaultbrowsercontext-2.spec.ts @@ -136,7 +136,8 @@ it('should restore state from userDataDir', async ({ browserType, server, create await browserContext3.close(); }); -it('should create userDataDir if it does not exist', async ({ createUserDataDir, browserType }) => { +it('should create userDataDir if it does not exist', async ({ createUserDataDir, browserType, browserName }) => { + it.fixme(browserName === 'firefox' && process.platform === 'darwin', 'Firefox launchPersistentContext intermittently times out on hosted macOS runners under load.'); const userDataDir = path.join(await createUserDataDir(), 'nonexisting'); const context = await browserType.launchPersistentContext(userDataDir); await context.close(); From 8bd818d4890edd7b2c659be25bdc07fd1951e8e3 Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Thu, 16 Jul 2026 10:03:06 +0200 Subject: [PATCH 2/3] test(firefox): handle slow Intel macOS runners Keep persistent-context coverage by extending the timeout on Intel macOS runners under load. Teach fix-flakes to preserve full histories, match runner architecture, and consider scoped slow annotations before skips. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1cf82c00-a3ef-48d5-9159-8f3e13f4ff27 --- .github/workflows/fix-flakes-prompt.md | 24 ++++++++++--------- .github/workflows/fix-flakes.yml | 11 +++++---- tests/library/defaultbrowsercontext-2.spec.ts | 1 + 3 files changed, 20 insertions(+), 16 deletions(-) diff --git a/.github/workflows/fix-flakes-prompt.md b/.github/workflows/fix-flakes-prompt.md index ba43719927477..29acc7016bf0d 100644 --- a/.github/workflows/fix-flakes-prompt.md +++ b/.github/workflows/fix-flakes-prompt.md @@ -20,7 +20,8 @@ bots/PRs it disrupts — **not** by "has a tidy error message". Pick a candidate whose failing `bot_name` OS matches yours so you can reproduce it. Keep the ranked list — you fall back down it in step 2. Say why you picked the top one. Once you have the target, use the "Generate a linked emoji run history" recipe in -`.claude/skills/playwright-test-results/SKILL.md`. Keep the Markdown output for the PR body. +`.claude/skills/playwright-test-results/SKILL.md`. Include the complete output in the PR body: +never trim it or remove green runs, and check the square count matches the per-run row count. ## 2. Check nobody's on it — and that it isn't already fixed @@ -33,9 +34,8 @@ down your step-1 ranking, re-checking each; only stop once the whole shortlist i before a fix landed, so a test fixed mid-window looks maximally bimodal (old fails + new passes), which is exactly what floats it up step 1. Check whether a fix has landed since it last flaked: find the commit its most recent failing run ran on, and look at what's changed - in that test's file since. A commit that plausibly targets the test or its feature — a - browser roll, or a fix to the test or the code it exercises — means the remaining DB fails - are from before the fix, so move on. + in that test's file since. Only move on if enough subsequent runs show the failures stopped; + a browser roll alone is not evidence of a fix. ## 3. Reproduce on this OS @@ -59,15 +59,17 @@ are project-locked, so use the one matching the failing bot: Other suites (electron `etest`, etc.): see `package.json` scripts. Add `--repeat-each=N` to force a flake's flip. -**You can only reproduce what this OS reaches.** A failure you can't reach here is itself -evidence it's environment-specific — a skip candidate (step 6), not a blind-fix. -Keep any OS handling keyed on the *current* OS, never hardcoded. +**You can only reproduce what this OS and architecture reaches.** Match both from `bot_name`; +non-reproduction under lighter local load or on another architecture is not itself a skip candidate. +Keep any OS/architecture handling keyed on the *current* environment, never hardcoded. Broader OS coverage comes from different agent runs on other OSes, not from you. ## 4. Fix — root cause or scoped skip - **Tractable → fix the source.** Usually a test-side race: a missing `await`, waiting on the wrong signal, an under-specified locator, leaked state. Fix the test (or the product bug). +- **Timeout → check the budget before skipping.** Compare passing durations and neighboring tests; + if working tests share an expensive operation near the timeout, prefer a scoped `it.slow()`. - **Engine/OS-specific, unreachable here, or genuinely hard → scope a skip**, narrowed to the exact failing condition — never a whole file or browser: @@ -81,9 +83,9 @@ Broader OS coverage comes from different agent runs on other OSes, not from you. flake-fighter rarely is). Never `skip` just to turn a red green. **Verify locally — your PR gets no CI (step 6), so this is the only proof:** flake → re-run with -`--repeat-each` and confirm it's stable; skip → confirm it's skipped on the target config and -**still runs elsewhere**. Then run `npm run flint`. Record exactly what you ran — it goes in the -PR body. +`--repeat-each` and confirm it's stable; slow → confirm it still runs and passes; skip → confirm +it's skipped on the target config and **still runs elsewhere**. Then run `npm run flint`. Record +exactly what you ran — it goes in the PR body. ## 5. Pick a reviewer @@ -121,4 +123,4 @@ Report what you committed, the reviewer, and why. - **One target, one commit.** Don't batch. - **Scoped skips only** — narrow to the failing condition, never a whole file or browser matrix. -- **No unverified PRs** — if you couldn't run it locally, prefer a documented fixme. +- **No unverified PRs** — if you cannot validate a scoped mitigation, make no commit. diff --git a/.github/workflows/fix-flakes.yml b/.github/workflows/fix-flakes.yml index 346f7359378b4..c2fcb65e2d8fc 100644 --- a/.github/workflows/fix-flakes.yml +++ b/.github/workflows/fix-flakes.yml @@ -73,11 +73,12 @@ jobs: via the playwright-test-results skill. \`bot_name\` encodes the OS. Write your answer to output/runner.txt, and nothing else there: exactly one of these - six runner labels, or the single word \`none\` if no OS is worth a run. + seven runner labels, or the single word \`none\` if no platform is worth a run. ubuntu-22.04 ubuntu-22.04-arm ubuntu-24.04 - macos-14-xlarge macos-15-xlarge windows-latest - Map a candidate's \`bot_name\` to the closest of those (e.g. \`*-macos-15-*\` -> - macos-15-xlarge). Explain your reasoning briefly in your final message. + macos-14-xlarge macos-15-large macos-15-xlarge windows-latest + Map \`*-macos-15-large\` to \`macos-15-large\` and \`*-macos-15-xlarge\` to + \`macos-15-xlarge\`; never substitute one architecture for another. Explain your + reasoning briefly in your final message. ${HINT:+Focus hint from the operator: $HINT} EOF @@ -102,7 +103,7 @@ jobs: exit 0 fi case "$runner" in - ubuntu-22.04|ubuntu-22.04-arm|ubuntu-24.04|macos-14-xlarge|macos-15-xlarge|windows-latest) ;; + ubuntu-22.04|ubuntu-22.04-arm|ubuntu-24.04|macos-14-xlarge|macos-15-large|macos-15-xlarge|windows-latest) ;; *) echo "::error::Triage chose a non-allowlisted runner: '$runner'." >&2; exit 1 ;; esac echo "Triage chose runner: $runner" diff --git a/tests/library/defaultbrowsercontext-2.spec.ts b/tests/library/defaultbrowsercontext-2.spec.ts index 14345e0457b2b..a6e08fff30711 100644 --- a/tests/library/defaultbrowsercontext-2.spec.ts +++ b/tests/library/defaultbrowsercontext-2.spec.ts @@ -20,6 +20,7 @@ import fs from 'fs'; import path from 'path'; it.skip(({ mode }) => mode !== 'default', 'Remote persistent contexts are not supported'); +it.slow(({ browserName, isMac }) => browserName === 'firefox' && isMac && process.arch === 'x64', 'Persistent Firefox launches are slow on Intel macOS runners under load.'); it('should support hasTouch option', async ({ server, launchPersistent }) => { const { page } = await launchPersistent({ hasTouch: true }); From 8300a58f95e672982e4001546380a393ffdedb37 Mon Sep 17 00:00:00 2001 From: Simon Knott Date: Thu, 16 Jul 2026 10:12:40 +0200 Subject: [PATCH 3/3] test(firefox): keep user data directory coverage Remove the macOS fixme now that the shared persistent-context timeout is extended for loaded Intel runners. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 1cf82c00-a3ef-48d5-9159-8f3e13f4ff27 --- tests/library/defaultbrowsercontext-2.spec.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/library/defaultbrowsercontext-2.spec.ts b/tests/library/defaultbrowsercontext-2.spec.ts index a6e08fff30711..f0eb64bd80db2 100644 --- a/tests/library/defaultbrowsercontext-2.spec.ts +++ b/tests/library/defaultbrowsercontext-2.spec.ts @@ -137,8 +137,7 @@ it('should restore state from userDataDir', async ({ browserType, server, create await browserContext3.close(); }); -it('should create userDataDir if it does not exist', async ({ createUserDataDir, browserType, browserName }) => { - it.fixme(browserName === 'firefox' && process.platform === 'darwin', 'Firefox launchPersistentContext intermittently times out on hosted macOS runners under load.'); +it('should create userDataDir if it does not exist', async ({ createUserDataDir, browserType }) => { const userDataDir = path.join(await createUserDataDir(), 'nonexisting'); const context = await browserType.launchPersistentContext(userDataDir); await context.close();