Repository navigation
test: fix Stagehand binary cache race in plugin tests - #2460
Merged
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2460 +/- ##
==========================================
- Coverage 94.25% 94.14% -0.11%
==========================================
Files 184 184
Lines 13690 13690
==========================================
- Hits 12904 12889 -15
- Misses 786 801 +15
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
vdusek
marked this pull request as ready for review
November 17, 2026 09:54
B4nan
approved these changes
Nov 18, 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.
test_methods_raise_error_when_not_activecreates a realAsyncStagehand, which copies the Stagehand binary into the per-user cache. It did not use thestagehand_binaryfixture, so it skipped theFileLockadded in #2418. With--dist worksteal, it can run on one worker while another worker is inside the locked fixture. Both write the same.tmpfile and then rename it, and the rename fails withWinError 32on Windows (failed run) orFileNotFoundErroron Linux.Changes:
test_stagehand_browser_plugin.pyuses thestagehand_binaryfixture through a module-levelpytestmark, so a new test in the file can't skip the lock.stagehand.__version__, the versionAsyncStagehanduses. Before, a setSTAGEHAND_VERSIONmade it fill a different cache directory than the client.Each change was checked locally with a 3 s delay patched in between the write and the rename, and a fresh cache for each run:
STAGEHAND_VERSIONset: 3 of 3 failed before, 0 of 3 after.✍️ Drafted by Claude Code