fix(context): handle concurrent directory creation - #1349
Conversation
Parallel pytest workers can share the default repository paths. Test
runs may fail with:
<Result FileExistsError(17, 'File exists')>
Two workers may both observe a missing directory before one creates it,
causing the other worker's mkdir() call to fail.
Use `exist_ok=True` so `WorkContext.setup()` tolerates that race.
Co-Authored-By: OpenAI Codex <codex@openai.com>
Signed-off-by: Ihar Hrachyshka <ihar.hrachyshka@gmail.com>
|
Warning Review limit reachedNext included review available in 37 minutes. View limit detailsLimit details: You’ve used the included review currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository: python-wheel-build/fromager/.coderabbit.yaml Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (2)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
rd4398
left a comment
There was a problem hiding this comment.
This looks good! Thanks for the fix!
|
This pull request does not currently match the merge queue conditions, so it cannot be queued from here. The box comes back if it matches again. |
|
@mergify rebase |
❌ This pull request comes from a fork and cannot be rebasedDetailsGitHub refuses an OAuth token on its rebase API for a fork, so rebasing one means impersonating a GitHub user to force-push the contributor's branch. Mergify does not do that. Use the |
Pull Request Description
What
Parallel pytest workers can share the default repository paths. Test
runs may fail with:
Two workers may both observe a missing directory before one creates it,
causing the other worker's mkdir() call to fail.
Use
exist_ok=TruesoWorkContext.setup()tolerates that race.Why