Skip to content

chore(utils): always use setImmediate in makeWaitForNextTask - #42456

Merged
Yury Semikhatsky (yury-s) merged 2 commits into
microsoft:mainfrom
yury-s:simplify-wait-for-next-task
Aug 29, 2026
Merged

chore(utils): always use setImmediate in makeWaitForNextTask#42456
Yury Semikhatsky (yury-s) merged 2 commits into
microsoft:mainfrom
yury-s:simplify-wait-for-next-task

Conversation

@yury-s

Copy link
Copy Markdown
Member

Summary

Node < 11 and the Electron setImmediate bug
(electron/electron#28261) are no longer relevant
now that Node 20+ is required and the Electron issue has been fixed.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Inline it

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

1 failed
❌ [playwright-test] › hooks.spec.ts:652 › should not report error from test fixture teardown when beforeAll times out @ubuntu-latest-node26

8 flaky⚠️ [chromium-library] › library/browsertype-connect.spec.ts:714 › run-server › should record trace with sources `@chromium-ubuntu-22.04-arm-node20`
⚠️ [chromium-library] › library/video.spec.ts:495 › screencast › should capture static page in persistent context Radoslav Kirilov (@smoke) `@realtime-time-library-chromium-linux`
⚠️ [chromium-library] › library/video.spec.ts:699 › screencast › should capture full viewport on hidpi `@realtime-time-library-chromium-linux`
⚠️ [chromium-library] › library/video.spec.ts:699 › screencast › should capture full viewport on hidpi `@chromium-ubuntu-22.04-node24`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:257 › third party 'Partitioned;' cookies `@firefox-ubuntu-22.04-node20`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:470 › top level 'Partitioned;' cookie and same origin iframe `@firefox-ubuntu-22.04-node20`
⚠️ [playwright-test] › ui-mode-trace.spec.ts:715 › should indicate current test status `@windows-latest-node22`
⚠️ [playwright-test] › ui-mode-trace.spec.ts:827 › should update state on subsequent run `@windows-latest-node22`

51273 passed, 1241 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

1 failed
❌ [firefox] › mcp/network.spec.ts:210 › browser_network_requests lists a failed request once @mcp-macos-latest-firefox

8304 passed, 1367 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

🟢 CI is clear — both hard failures are pre-existing flakes

Hi, I'm the Playwright bot and I took a look at the failing CI. Neither hard failure traces to this PR: both fail on the same test on unrelated PRs. This change swaps makeWaitForNextTask() for setImmediate in the browser transports and the navigation barrier, and nothing here reaches either failing test in a way the history doesn't already explain.

Details

Overall: the diff only touches playwright-core browser transports (transport.ts, pipeTransport.ts, android.ts) and the frames.ts navigation signal barrier. The two hard failures are a test-runner fixture-timeout test and a macOS-only MCP network flake — both have a failure history on SHAs this PR can't be responsible for. The 8 flaky entries in the report were rescued on retry, so there's nothing to triage there.

Pre-existing flake / infra

  • [playwright-test] › hooks.spec.ts:652 › should not report error from test fixture teardown when beforeAll times out@ubuntu-latest-node26 — pre-existing flake. Across the results DB this test's final verdict has gone red in exactly 2 of ~4623 runs: this PR (ubuntu-latest-node26) and unrelated PR feat(test-runner): add --merge-strategy flag to merge-reports #42287 (sha 550e081e4e, ubuntu-latest-node24) — both the newer-Node single-worker bots. It's a race between the 1000 ms beforeAll timeout and teardown-error propagation (the assertion is that the output should not contain Error: Oh my!), which lives entirely in the test runner. The diff doesn't touch the runner's fixture/timeout machinery, and the node26 bot itself is healthy (22 failed finals across 1.23M results).

  • [firefox] › mcp/network.spec.ts:210 › browser_network_requests lists a failed request once@mcp-macos-latest-firefox — pre-existing macOS flake (toHaveLength(1) got 0; the failed request wasn't listed yet). Same test has failed at retry 0 on macOS across all three browsers on unrelated PRs: fix(aria): keep icon-only clickable elements in ai snapshots #42034 (mcp-macos-latest-firefox), feat(trace): add action screenshot and aria snapshot events #42167 (mcp-macos-latest-chrome), feat(trace-viewer): add "Display Aria" mode #42211 (mcp-macos-latest-webkit). It's green on every non-macOS bot in this PR's own run. A transport-timing regression from this diff would show up on all OSes, not just macOS — so the macOS-only signature points at the existing flake, not this change.

Triaged by the Playwright bot - agent run

@github-actions

Copy link
Copy Markdown
Contributor

Hi, I'm the Playwright bot and I took a first look at the failing CI.

🟢 CI is clear — both real failures are pre-existing flakes

The two red tests fail the same way on unrelated PRs, and this change is a no-op on the bots where they failed: makeWaitForNextTask() already returned setImmediate for non-Electron Node ≥ 11, which is exactly ubuntu-latest-node26 and mcp-macos-latest-firefox. Nothing here reaches them.

Details

Overall: the diff only changes behaviour under Node < 11 (obsolete) and Electron; on every standard CI bot it's identical to the old code. Electron jobs passed. The two failures below both land on standard bots, so the PR can't be the cause — and the history confirms they flake on their own.

Pre-existing flake / infra

Not triaged

The 8 "flaky" entries in the report (video screencast, third-party cookies, browsertype-connect trace, ui-mode-trace) all passed on retry and are unrelated to task scheduling.

Triaged by the Playwright bot - agent run

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 2"

31 flaky⚠️ [chromium-library] › library/browsercontext-page-event.spec.ts:173 › should work with Ctrl-clicking `@tracing-chromium`
⚠️ [chromium-library] › library/video.spec.ts:495 › screencast › should capture static page in persistent context Radoslav Kirilov (@smoke) `@msedge-dev-windows-latest`
⚠️ [chromium-library] › library/chromium/chromium.spec.ts:301 › should report intercepted service worker requests in HAR `@chrome-ubuntu-22.04`
⚠️ [chromium-library] › library/trace-viewer-scrub.spec.ts:177 › should drag scrubber to select action `@chromium-windows-latest`
⚠️ [chromium-library] › library/video.spec.ts:736 › screencast › should work with video+trace `@chromium-windows-latest`
⚠️ [chromium-library] › library/chromium/oopif.spec.ts:179 › should take screenshot `@chromium-macos-14-xlarge`
⚠️ [chromium-library] › library/chromium/chromium.spec.ts:213 › should intercept service worker requests (main and within) `@chrome-beta-ubuntu-22.04`
⚠️ [chromium-library] › library/chromium/chromium.spec.ts:301 › should report intercepted service worker requests in HAR `@chrome-beta-ubuntu-22.04`
⚠️ [chromium-library] › library/chromium/chromium.spec.ts:373 › should produce network events, routing, and annotations for Service Worker `@chrome-beta-ubuntu-22.04`
⚠️ [chromium-library] › library/selector-generator.spec.ts:213 › selector generator › should use data-testid in strict errors `@chrome-macos-latest`
⚠️ [chromium-library] › library/selector-generator.spec.ts:564 › selector generator › should ignore empty role for candidate consideration `@chrome-macos-latest`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:257 › third party 'Partitioned;' cookies `@tracing-firefox`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:470 › top level 'Partitioned;' cookie and same origin iframe `@tracing-firefox`
⚠️ [firefox-page] › page/page-event-request.spec.ts:181 › should return response body when Cross-Origin-Opener-Policy is set `@tracing-firefox`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:257 › third party 'Partitioned;' cookies `@firefox-macos-15-large`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:470 › top level 'Partitioned;' cookie and same origin iframe `@firefox-macos-15-large`
⚠️ [firefox-library] › library/defaultbrowsercontext-1.spec.ts:89 › should support viewport option `@firefox-macos-15-large`
⚠️ [firefox-library] › library/inspector/cli-codegen-csharp.spec.ts:202 › should not print context options method override in xunit if no options were passed `@firefox-macos-15-large`
⚠️ [firefox-library] › library/inspector/cli-codegen-javascript.spec.ts:51 › should work with --http-credentials `@firefox-macos-15-large`
⚠️ [firefox-library] › library/inspector/cli-codegen-python.spec.ts:76 › should save the codegen output to a file if specified `@firefox-macos-15-large`
⚠️ [firefox-page] › page/page-emulate-media.spec.ts:144 › should keep reduced motion and color emulation after reload `@firefox-macos-15-large`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:257 › third party 'Partitioned;' cookies `@firefox-windows-latest`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:470 › top level 'Partitioned;' cookie and same origin iframe `@firefox-windows-latest`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:560 › should(not) block third party cookies - persistent context `@firefox-windows-latest`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:257 › third party 'Partitioned;' cookies `@firefox-macos-15-xlarge`
⚠️ [firefox-library] › library/browsercontext-cookies-third-party.spec.ts:470 › top level 'Partitioned;' cookie and same origin iframe `@firefox-macos-15-xlarge`
⚠️ [firefox-page] › page/page-goto.spec.ts:90 › should work with Cross-Origin-Opener-Policy `@firefox-macos-15-xlarge`
⚠️ [webkit-page] › page/page-autowaiting-basic.spec.ts:79 › should await form-post on click `@tracing-webkit`
⚠️ [webkit-library] › library/inspector/cli-codegen-test.spec.ts:57 › should print the correct context options when using a device and additional options `@webkit-windows-latest`
⚠️ [webkit-library] › library/browsertype-connect.spec.ts:807 › run-server › should upload a folder `@webkit-macos-15-large`
⚠️ [webkit-library] › library/screencast.spec.ts:57 › applies backpressure while async onFrame callback is pending `@webkit-macos-15-large`

110484 passed, 4723 skipped


Merge workflow run.

@yury-s
Yury Semikhatsky (yury-s) merged commit de214f4 into microsoft:mainAug 29, 2026
73 of 75 checks passed
@yury-s
Yury Semikhatsky (yury-s) deleted the simplify-wait-for-next-task branch August 29, 2026 01:43
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@yury-s@pavelfeldman