Skip to content

test(firefox): fixme flaky codegen pierceFrames disambiguation on Intel macOS - #42131

Merged
Simon Knott (Skn0tt) merged 3 commits into
mainfrom
fix-flakes/macos-15-large-30984018624
Aug 10, 2026
Merged

test(firefox): fixme flaky codegen pierceFrames disambiguation on Intel macOS#42131
Simon Knott (Skn0tt) merged 3 commits into
mainfrom
fix-flakes/macos-15-large-30984018624

Conversation

@microsoft-playwright-automation

Copy link
Copy Markdown
Contributor

Hi, I'm the Playwright bot. cli codegen with pierceFrames › should prepend the frame selector to disambiguate is flaky, but only on firefox-macos-15-large (Intel macOS) — 8 failures / 46 runs (17.4%) in the recent window, and zero failures on every other bot (chromium, webkit, firefox arm64, ubuntu). Reproduced locally on Intel macOS with --repeat-each=15 --workers=6: 3 flaky, all the same failure.

Root cause is a timing race, not a bad assertion: buildFullSelectorForFrame races the cross-frame piercing-selector resolution against a hardcoded 2000ms deadline and, on timeout, falls back to the internal:control=no-pierce-frames opt-out. Under load on the Intel macOS runner that race times out, so the recorder emits page.pierceFrames({ pierce: false }).locator('#frame1')… instead of the expected piercing selector. test.slow() wouldn't help — the 2s budget is internal to the recorder, independent of the test timeout. Same Intel-macOS-firefox-under-load class as #41811.

Scoped test.fixme to browserName === 'firefox' && isMac && process.arch === 'x64'; the test still runs everywhere else.

Run history for firefox-macos-15-large (oldest first, 46 runs):

🟧🟥🟩🟩🟩🟩🟩🟩🟧🟩🟩🟩🟩🟩🟥🟩🟧🟩🟩🟩🟩🟩🟩🟩🟥🟩🟩🟩🟩🟥🟩🟩🟩🟩🟥🟩🟩🟩🟩🟥🟥🟥🟩🟩🟩🟩

What I verified locally (Intel macOS, x64)
  • Reproduced: npm run ftest -- tests/library/inspector/cli-codegen-3.spec.ts:1169 --repeat-each=15 --workers=6 -> 3 flaky with the pierce: false opt-out.
  • After fix: firefox -> 1 skipped; chromium (npm run ctest -- …:1169) -> 1 passed.
  • npm run flint -> clean.
  • CI run: https://github.com/microsoft/playwright/actions/runs/30984018624

Suggested-reviewer: dgozman

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

…el macOS
Hi, I'm the Playwright bot. `cli codegen with pierceFrames › should prepend the frame selector to disambiguate` is flaky, but **only on `firefox-macos-15-large` (Intel macOS)** — 8 failures / 46 runs (17.4%) in the recent window, and zero failures on every other bot (chromium, webkit, firefox arm64, ubuntu). Reproduced locally on Intel macOS with `--repeat-each=15 --workers=6`: 3 flaky, all the same failure.
Root cause is a timing race, not a bad assertion: `buildFullSelectorForFrame` races the cross-frame piercing-selector resolution against a hardcoded 2000ms deadline and, on timeout, falls back to the `internal:control=no-pierce-frames` opt-out. Under load on the Intel macOS runner that race times out, so the recorder emits `page.pierceFrames({ pierce: false }).locator('#frame1')…` instead of the expected piercing selector. `test.slow()` wouldn't help — the 2s budget is internal to the recorder, independent of the test timeout. Same Intel-macOS-firefox-under-load class as #41811.
Scoped `test.fixme` to `browserName === 'firefox' && isMac && process.arch === 'x64'`; the test still runs everywhere else.
Run history for `firefox-macos-15-large` (oldest first, 46 runs):
[🟧](https://github.com/microsoft/playwright/actions/runs/30490403874/attempts/1)[🟥](https://github.com/microsoft/playwright/actions/runs/30493031010/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30495285330/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30530696555/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30534756293/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30539645601/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30542293233/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30542345092/attempts/1)[🟧](https://github.com/microsoft/playwright/actions/runs/30559579795/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30565052100/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30568188818/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30568293053/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30568320872/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30577572373/attempts/1)[🟥](https://github.com/microsoft/playwright/actions/runs/30581383958/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30581357288/attempts/1)[🟧](https://github.com/microsoft/playwright/actions/runs/30581405526/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30585190825/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30618799783/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30624512498/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30653773411/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30667286182/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30667347031/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30833251658/attempts/1)[🟥](https://github.com/microsoft/playwright/actions/runs/30850656923/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30850749658/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30854798001/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30859315578/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30859305376/attempts/1)[🟥](https://github.com/microsoft/playwright/actions/runs/30859360344/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30885108613/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30885140825/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30885208556/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30885237385/attempts/1)[🟥](https://github.com/microsoft/playwright/actions/runs/30885274230/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30917613834/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30927071352/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30927719515/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30930057055/attempts/1)[🟥](https://github.com/microsoft/playwright/actions/runs/30933859878/attempts/1)[🟥](https://github.com/microsoft/playwright/actions/runs/30934926278/attempts/1)[🟥](https://github.com/microsoft/playwright/actions/runs/30940141663/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30945227770/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30954253724/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30954381228/attempts/1)[🟩](https://github.com/microsoft/playwright/actions/runs/30955628029/attempts/1)
<details>
<summary>What I verified locally (Intel macOS, x64)</summary>
- Reproduced: `npm run ftest -- tests/library/inspector/cli-codegen-3.spec.ts:1169 --repeat-each=15 --workers=6` -> 3 flaky with the `pierce: false` opt-out.
- After fix: firefox -> `1 skipped`; chromium (`npm run ctest -- …:1169`) -> `1 passed`.
- `npm run flint` -> clean.
- CI run: https://github.com/microsoft/playwright/actions/runs/30984018624
</details>
Suggested-reviewer: dgozman
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

12 flaky⚠️ [chromium-library] › library/chromium/chromium.spec.ts:211 › should intercept service worker requests (main and within) `@frozen-time-library-chromium-linux`
⚠️ [chromium-library] › library/video.spec.ts:294 › screencast › should capture navigation `@frozen-time-library-chromium-linux`
⚠️ [chromium-library] › library/video.spec.ts:736 › screencast › should work with video+trace `@frozen-time-library-chromium-linux`
⚠️ [chromium-library] › library/video.spec.ts:664 › screencast › should capture full viewport `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-library] › library/video.spec.ts:699 › screencast › should capture full viewport on hidpi `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-library] › library/video.spec.ts:736 › screencast › should work with video+trace `@realtime-time-library-chromium-linux`
⚠️ [chromium-library] › library/video.spec.ts:736 › screencast › should work with video+trace `@chromium-ubuntu-22.04-node24`
⚠️ [chromium-library] › library/chromium/chromium.spec.ts:371 › should produce network events, routing, and annotations for Service Worker `@chromium-ubuntu-22.04-node22`
⚠️ [chromium-library] › library/video.spec.ts:699 › screencast › should capture full viewport on hidpi `@chromium-ubuntu-22.04-node22`
⚠️ [firefox-page] › page/page-emulate-media.spec.ts:144 › should keep reduced motion and color emulation after reload `@firefox-ubuntu-22.04-node20`
⚠️ [firefox-page] › page/page-event-request.spec.ts:181 › should return response body when Cross-Origin-Opener-Policy is set `@firefox-ubuntu-22.04-node20`
⚠️ [playwright-test] › ui-mode-trace.spec.ts:715 › should indicate current test status `@windows-latest-node22`

51217 passed, 1190 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

8050 passed, 1284 skipped


Merge workflow run.

@Skn0tt

Copy link
Copy Markdown
Contributor

Copilot if the 2s race is the problem, maybe we can make those 2s configurable and extend them just under intel macOS tests? It seems like that would be the better fix.

Co-authored-by: Skn0tt <14912729+Skn0tt@users.noreply.github.com>

CopilotAI commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Copilot if the 2s race is the problem, maybe we can make those 2s configurable and extend them just under intel macOS tests? It seems like that would be the better fix.

Implemented in 9fa9ed4. The recorder’s frame-selector timeout now defaults to 2s and this test raises it to 10s only on Firefox Intel macOS, so it runs instead of being skipped.

export async function buildFullSelectorForFrame(progress: Progress, frame: Frame, selector: string): Promise<string> {
const framePath = await generateFrameSelector(progress, frame);
export async function buildFullSelectorForFrame(progress: Progress, frame: Frame, selector: string, timeout = 2000): Promise<string> {
const framePath = await generateFrameSelector(progress, frame, timeout);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's instead check isUnderTest() and always use 10000 in this case?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot dima is right, do it!

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implemented in 7fdb420. Frame-selector generation now uses a 10s deadline whenever isUnderTest() is true, while production retains 2s.

Co-authored-by: Skn0tt <14912729+Skn0tt@users.noreply.github.com>
@Skn0tt
Simon Knott (Skn0tt) merged commit 8078b85 into mainAug 10, 2026
41 of 43 checks passed
@Skn0tt
Simon Knott (Skn0tt) deleted the fix-flakes/macos-15-large-30984018624 branch August 10, 2026 09:45
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants

@Skn0tt@dgozman