Playwright Local Browser Server Start can race with in-progress Stop

Open
#5,852 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
20/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
playwright, typescript, vscode
Domain
tooling

Research direction

Review PR #5851 first, then trace handleStopTunnelAsync() and the Start path in the Playwright Local Browser Server VS Code extension. Check the focused real VS Code host regression test for the rapid Start/Stop/Start sequence; done means the replacement tunnel waits for shutdown and the regression test passes.

Written by the indexing model from the issue text.

Description

Summary

The Playwright Local Browser Server VS Code extension can get into a lifecycle race when Stop and Start are invoked in quick succession. The user-visible symptom is that Start/Stop sometimes needs to be run twice before the tunnel reaches the expected state.

Suspected cause

handleStopTunnelAsync() can make the active tunnel unavailable before the existing tunnel has fully finished stopAsync(). A following Start command can then proceed while the previous shutdown is still in progress.

Proposed fix

PR #5851 tracks an in-progress stop promise, waits for it before starting a replacement tunnel, and only clears the active tunnel reference after stopAsync() settles.

The PR also adds a focused real VS Code host regression test for the rapid Start/Stop/Start sequence.

Dominant language
TypeScript
Stars
6.5k
Forks
708
Avg merge
5d 19h
Merged PRs (30d)
48

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from microsoft/rushstack

All issues in microsoft/rushstack

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.