fix: keep reused browser when stopping the debugging - #808
fix: keep reused browser when stopping the debugging#808Ashraf Ali (ashrafiucse) wants to merge 1 commit into
Conversation
Stopping a debug session tears down the debugged test process, which also tears down its browser page. When the page count then dropped to zero, the extension killed the reused browser backend as well, closing the browser instead of keeping it around for inspection and recording. Keep the backend alive after a debug run with "Show Browser" enabled, both when the run ends and when a late page-count update arrives. Fixes: microsoft/playwright#37822
|
Quick context for reviewers: I initially explored a core-side fix for this in microsoft/playwright#42461, but closed it after the feedback there — changing how reuse-mode connections tear down isn't the direction you want. So this PR deliberately stays on the extension side: core behavior is untouched, it just stops the extension from killing the backend when the page count briefly drops to zero after a debug session ends. I re-verified the fix and its regression test against current playwright main (with #42458 merged in core) and everything still passes. Without this change the issue is still reproducible — and judging by the latest comment on the issue, the suggested workaround doesn't fully work either — so keeping this open for review. That said, if you'd rather handle it differently (e.g. core-side after all), I'm happy to close or rework this. |
Summary
onDidRunTests()and the late_pageCountChanged(0)update both killed the reused browser backend, closing the browser instead of keeping it for inspection and recordingAddresses microsoft/playwright#37822 (the issue is closed by the root-cause fix below; this hardens the extension side and covers workspaces pinned to older cores).
The root cause (pages torn down with the connection) is fixed core-side: microsoft/playwright#42461
Related: #807 fixes stale recorder actions inserted while editing during "Record at cursor" (microsoft/playwright#42218).