Repository navigation
Fix #11603 follow-up: Correct make_numbered_dir multiprocess-safety docstring - #15542
Open
ARUNAGIRINATHAN-K wants to merge 3 commits into
Open
ARUNAGIRINATHAN-K wants to merge 3 commits into
ARUNAGIRINATHAN-K wants to merge 3 commits into
Conversation
…s-safety docstring Legacy py.path.local.make_numbered_dir is not guaranteed multiprocess-safe per pytest-dev#11611, even with lock files. Update docstring to reflect that and point to _pytest.pathlib.make_numbered_dir_with_cleanup used by pytest core.
This branch has not been deployed
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.
Follow-up to #11603 / #11611
Investigation: Ran
test_make_numbered_dir_multiprocess_safe20/20 isolatedWindows runs with
--runxfailon pytest 10.0.0.dev108+gf0b067d19 / Python 3.13.14.All passed. With normal marker, test reports XPASS.
That does not invalidate the Fedora CI failures in #11603 (1-2/10 builds).
20 Windows runs do not prove the race is absent — conditions differ
(no pytest-xdist, different scheduler / FS).
What remains is a documentation inconsistency:
src/_pytest/_py/path.py:1275—py.path.local.make_numbered_dirdocstring still describes the locked algorithm as multiprocess-safe,
contrary to the upstream finding in #11611:
process creates it first -> retry can raise EEXIST
-> ENOENT
This PR does NOT change behavior. It corrects the docstring to state
that the legacy implementation is NOT guaranteed multiprocess-safe,
and points users to pytest's
pathlib.make_numbered_dir_with_cleanup(
src/_pytest/pathlib.py:481, used viatmpdir.py:265) for pytest'sown temp-dir flow.
No source files modified in investigation. No new defect claimed.
What To Actually Change
In src/_pytest/_py/path.py around line 1275: