fix(server): close browsers when PlaywrightServer shuts down#40294
Conversation
In extension/reuse mode, PlaywrightServer launches browsers that intentionally outlive individual client connections (for reuse). But when the server itself closes, those browsers were never cleaned up, leaking browser processes. This caused worker teardown timeouts on Edge/macOS CI: the orphaned Edge process kept SmartScreen background connections alive, preventing clean shutdown of worker-scoped test fixtures.
Test results for "MCP"14 failed 6407 passed, 976 skipped Merge workflow run. |
Test results for "tests 1"1 failed 5 flaky39242 passed, 847 skipped Merge workflow run. |
Summary
PlaywrightServerlaunches browsers that intentionally outlive individual client connections (for reuse across reconnects). However, when the server itself shuts down viaclose(), those browsers were never cleaned up — leaking browser processes.debug-controller.spec.tson all three Edge/macOS CI bots. The orphaned Edge process kept SmartScreen background connections alive, preventing clean shutdown of worker-scoped test fixtures.