Skip to content

fix(context): handle concurrent directory creation - #1349

Merged
LalatenduMohanty merged 1 commit into
python-wheel-build:mainfrom
booxter:fromager-test-race-mkdir
Sep 29, 2026
Merged

LalatenduMohanty merged 1 commit into
python-wheel-build:mainfrom
booxter:fromager-test-race-mkdir

Conversation

@booxter

@booxter booxter commented Sep 27, 2026

Copy link
Copy Markdown
Contributor

Pull Request Description

What

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.

Why

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>
@booxter
booxter requested a review from a team as a code owner September 27, 2026 19:19
@coderabbitai

coderabbitai Bot commented Sep 27, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 37 minutes.

Check out review usage here.

View limit details

Limit 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.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: Repository: python-wheel-build/fromager/.coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: dc5b27a3-b89d-455d-b030-af9574494fcc

📥 Commits

Reviewing files that changed from the base of the PR and between e724cb4 and 7f3e746.

📒 Files selected for processing (2)
  • src/fromager/context.py
  • tests/test_context.py

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@mergify mergify Bot added the ci label Sep 27, 2026

@rd4398 rd4398 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good! Thanks for the fix!

@mergify

mergify Bot commented Sep 28, 2026 •

Copy link
Copy Markdown
Contributor

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.

@rd4398

rd4398 commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

@mergify rebase

@mergify

mergify Bot commented Sep 28, 2026

Copy link
Copy Markdown
Contributor

rebase

❌ This pull request comes from a fork and cannot be rebased

Details

GitHub 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 update action or the @mergifyio update command instead: it brings the pull request up to date by merging the base branch into it, and needs no impersonation. It only has something to do when the pull request is behind its base branch, so if what the branch needs is a linear history, its author has to rebase it themselves.

@LalatenduMohanty
LalatenduMohanty merged commit 27db2d6 into python-wheel-build:main Sep 29, 2026
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants