Skip to content

tools: drive_test's Windows record race - #38

Merged
pinhopro merged 1 commit into
mainfrom
fix/drive-test-windows-race
Nov 20, 2026
Merged

pinhopro merged 1 commit into
mainfrom
fix/drive-test-windows-race

Conversation

@pinhopro

Copy link
Copy Markdown
Contributor

The final CI's MSVC 14.5 job failed in tools/drive/drive_test.py (test_a_killed_or_stopped_run_leaves_nothing): PermissionError: [Errno 13] Permission denied: ...terminated.json. It passed on the run before it, so it is a race, not a defect of the change under test.

Cause: the stand-in driver writes its record twice and replaces it with os.replace; on Windows a file that another process has open cannot be replaced or opened during the replace, so the test's read and the stand-in's replace can collide.

Fix: the stand-in retries its replace on PermissionError (up to 5 s), and the test's recorded() retries a read that hits PermissionError within its existing deadline. POSIX behaviour is unchanged; drive_test passes on macOS.

🤖 Generated with Claude Code

…d-in retries its record's replace and the test retries its read on PermissionError, which failed the MSVC 14.5 job at random
@pinhopro
pinhopro merged commit 4e3caa5 into main Nov 20, 2026
@pinhopro
pinhopro deleted the fix/drive-test-windows-race branch November 20, 2026 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant