Fix Playwright tunnel restart race#5851
Draft
justinTM wants to merge 2 commits into
Draft
Conversation
72c25f0 to
b684d04
Compare
b684d04 to
d16c95e
Compare
|
@justinTM please read the following Contributor License Agreement(CLA). If you agree with the CLA, please reply with the following information.
Contributor License AgreementContribution License AgreementThis Contribution License Agreement (“Agreement”) is agreed to by the party signing below (“You”),
|
This was referenced Jun 30, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #5852.
Fixes a lifecycle race in the Playwright Local Browser Server VS Code extension where a rapid stop/start could create a replacement tunnel before the previous tunnel finished stopping.
The extension now tracks an in-progress stop promise, waits for it before starting a replacement tunnel, and only clears the active tunnel reference after
stopAsync()settles.Commit structure
This PR is intentionally split into a red/green sequence:
39a590c935- adds the real VS Code host regression test only.d16c95ebb1- adds the lifecycle fix and change file.Red/green proof
Both runs used the same command sequence from
vscode-extensions/playwright-local-browser-server-vscode-extension:PATH=/Users/justin/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:$PATH /Users/justin/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin/node ../../common/scripts/install-run-rushx.js buildenv -u GITHUB_ACCESS_TOKEN -u GH_TOKEN -u GITHUB_TOKEN -u GITLAB_ACCESS_TOKEN -u RUNNER_REGISTRATION_TOKEN -u TAILSCALE_AUTH_KEY PATH=/Users/justin/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin:$PATH VSCODE_EXECUTABLE_PATH='/Applications/Visual Studio Code.app/Contents/MacOS/Electron' /Users/justin/.cache/codex-runtimes/codex-primary-runtime/dependencies/node/bin/node ../../common/scripts/install-run-rushx.js test:vscodeRed, at test-only commit
39a590c935:Green, after fix commit
d16c95ebb1:I also ran
git diff --check origin/main...HEADon the final branch.Notes
The
test:vscodescript launches a real VS Code extension host against the builtdist/vsix/unpackedextension using@vscode/test-electron. It runs a focused rapid Start/Stop/Start assertion that verifies restart remains pending while the prior Stop command is still in progress.