Skip to content

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

Description

@justinTM

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    Status
    Needs triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions