Repository navigation
test(cli): fix Windows race in concurrent daemon lock fixture - #3456
Merged
Merged
Conversation
|
Contributor
There was a problem hiding this comment.
No issues found across 1 file
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Architecture diagram
sequenceDiagram
participant Test as Concurrent Driver Test
participant Fixture as Lock Fixture
participant FS as fs Module
participant Code as Code Under Test
participant Daemon as Fake Daemon
alt waitsForLock set
Fixture->>FS: writeFile(lockPath, pid)
activate FS
FS-->>Fixture: lock file created
deactivate FS
Fixture->>FS: spyOn(open)
FS->>Code: acquireLock() - open(lockPath, "wx")
alt File exists (EEXIST)
FS-->>Code: error EEXIST
Code->>Fixture: sawOccupiedLock = true
Code->>Fixture: resolve waitingForLock
Fixture->>Fixture: await fixtureReady (paused)
else No lock yet
FS-->>Code: open success
end
end
Note over Test,Fixture: Fixture resumes after lock is occupied
Test->>Fixture: await waitingForLock
activate Fixture
Fixture->>Daemon: listen()
activate Daemon
Daemon-->>Fixture: started
deactivate Daemon
Fixture->>FS: rm(lockPath)
activate FS
FS-->>Fixture: removed
deactivate FS
Fixture->>Fixture: finally - resumeLockAcquisition()
Fixture->>Code: resume retry
activate Code
Code->>FS: open(lockPath, "wx") - retry
alt Lock removed
FS-->>Code: success
Code-->>Test: resolved result
else Lock still present
FS-->>Code: error EEXIST
end
deactivate Code
deactivate Fixture
5 tasks done
seanmcguire12
approved these changes
Nov 13, 2026
shrey150
added a commit
that referenced
this pull request
Nov 18, 2026
# why Help users find the Stagehand and Browse CLI community when they check help or encounter an unexpected error. This PR is stacked on #3450, which adds `browse discord` and the updated community invitation. # what changed Adds this footer to root help (`browse` and `browse --help`): ```text COMMUNITY Discord: https://discord.gg/stagehand Report a bug: https://github.com/browserbase/stagehand/issues ``` Unexpected runtime errors also print this hint to stderr: ```text Get help: https://discord.gg/stagehand · Report a bug: https://github.com/browserbase/stagehand/issues ``` The footer appears only on root help. Usage errors, command-not-found, and expected `CommandFailure` errors omit the support hint. For review, `packages/cli/src/help.ts` adds the footer and `packages/cli/src/base.ts` handles the error hint. Includes a **patch changeset for `browse`**. # test plan - [x] CLI TypeScript build and oclif manifest generation. - [x] Discord, opener, help, and CLI surface tests: **83 passed**. - [x] Unexpected-error subprocess case verifies both support links on stderr, the original error, and exit code 1; removing the hint makes the test fail. - [x] Changed-file formatting and lint. - [x] CI passing at `5c8de796d`, including Linux/Windows contracts, Chrome smoke tests, regression tests, and automated review. Windows contracts passed on rerun after the existing daemon-lock fixture `EPERM`; the isolated test fix is #3456. --------- Co-authored-by: Cursor Agent <[email protected]>
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.
why
The concurrent-daemon test intermittently fails on Windows with
EPERM: its fixture can remove the lock while the code under test is inspecting it or attempting to acquire it again.what changed
Synchronizes the fixture in
packages/cli/tests/driver-session.test.ts: wait until the occupied lock has been inspected, pause the next acquisition while starting the fake daemon and removing the lock, then resume infinally. The test still exercises real lock contention and retains every assertion.This changes only test synchronization. No changeset is needed because no shipped behavior changes.
test plan
75bee119c, including Linux/Windows contract and Chrome smoke tests; automated review found no issues.