Skip to content

fix(runner): do not force-kill worker while its teardown is in progress - #42010

Merged
pavelfeldman merged 1 commit into
microsoft:mainfrom
pavelfeldman:fix-42007
Jul 28, 2026
Merged

fix(runner): do not force-kill worker while its teardown is in progress#42010
pavelfeldman merged 1 commit into
microsoft:mainfrom
pavelfeldman:fix-42007

Conversation

@pavelfeldman

Copy link
Copy Markdown
Member

Summary

  • Worker sends heartbeats over IPC while gracefully closing, so a slow fixture teardown with timeout: 0 is not force-killed.
  • A genuinely hung worker (blocked event loop, process that will not exit) sends no heartbeats and is still force-killed, preserving fix(runner): force-kill worker that hangs on stop #40637.

Fixes #42007

Worker sends heartbeats while gracefully closing, so that a slow fixture
teardown with "timeout: 0" is not force-killed. A hung worker does not
send heartbeats and is still force-killed after the timeout.

Fixes: microsoft#42007
@github-actions

Copy link
Copy Markdown
Contributor

Test results for "tests 1"

6 flaky ⚠️ [chromium-library] › library/video.spec.ts:495 › screencast › should capture static page in persistent context @smoke `@realtime-time-library-chromium-linux`
⚠️ [chromium-library] › library/video.spec.ts:356 › screencast › should work for popups `@chromium-ubuntu-22.04-node24`
⚠️ [chromium-library] › library/video.spec.ts:495 › screencast › should capture static page in persistent context @smoke `@chromium-ubuntu-22.04-node24`
⚠️ [chromium-page] › page/workers.spec.ts:191 › should attribute network activity for worker inside iframe to the iframe `@chromium-ubuntu-22.04-node20`
⚠️ [firefox-page] › page/page-emulate-media.spec.ts:144 › should keep reduced motion and color emulation after reload `@firefox-ubuntu-22.04-node20`
⚠️ [playwright-test] › ui-mode-trace.spec.ts:827 › should update state on subsequent run `@windows-latest-node22`

50739 passed, 1190 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

Test results for "MCP"

2 failed
❌ [firefox] › mcp/cli-core.spec.ts:189 › dialog-accept @mcp-windows-latest-firefox
❌ [firefox] › mcp/dashboard.spec.ts:108 › should activate session when show is called with -s @mcp-windows-latest-firefox

7806 passed, 1266 skipped


Merge workflow run.

@github-actions

Copy link
Copy Markdown
Contributor

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

🟢 Nothing looks caused by this PR

Both MCP failures are pre-existing Firefox flakes, on flows this PR doesn't touch. The "tests 1" report has only flaky tests, no real failures. You're clear.

Details

This PR changes worker heartbeat / force-kill logic in the test runner (process.ts, processHost.ts, exit-code.spec.ts). None of the failing tests exercise that path.

Pre-existing flake / infra

  • [firefox] › mcp/cli-core.spec.ts:189 › dialog-accept <prompt> (@mcp-windows-latest-firefox) — Firefox-only flake. Across the test-results DB it flips verdict on unrelated SHAs: failed 7 of 488 firefox runs across 6 different PRs, passed the other 481; never failed on chromium/chrome/msedge/webkit.
  • [firefox] › mcp/dashboard.spec.ts:108 › should activate session when show is called with -s (@mcp-windows-latest-firefox) — same story: failed 18 of 488 firefox runs across 13 different PRs, passed 470, and never failed on the other engines.

Both are Firefox-only and reproduce across many PRs that can't be responsible, and the MCP dialog/dashboard flows don't touch worker teardown or force-kill — so this PR isn't implicated.

Note

  • The "tests 1" report lists 6 flaky (all rescued on retry) and 0 failures — nothing to triage there.

Triaged by the Playwright bot - agent run

@pavelfeldman
pavelfeldman merged commit 63ff5dc into microsoft:main Jul 28, 2026
48 of 50 checks passed
Sign up for free to 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.

[Regression]: worker fixture with timeout: 0 is force-killed mid-teardown by PWTEST_CHILD_PROCESS_TIMEOUT

2 participants