Repository navigation
Conversation
zyv
force-pushed
the
feature/fix-symlink-cleanup-race
branch
from
October 13, 2026 19:33
17ba06d to
5e145bf
Compare
Concurrent sessions of one user share `pytest-of-<user>`, and a session can unlink the dead `pytest-current` symlink after another session checked it, which raised `FileNotFoundError` from `pytest_sessionfinish`. Co-authored-by: Claude Opus 5.5 Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
zyv
force-pushed
the
feature/fix-symlink-cleanup-race
branch
from
October 14, 2026 08:06
5e145bf to
10b1643
Compare
Author
|
I have added the changelog entry under this PR's number, and the last edit is cosmetic - it hopefully removes 1 uncovered line in the mock. I'm not sure what was up with readthedocs; I guess it was some problem unrelated to my changes, but everything seems to be green now. |
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.
I run many pytest sessions in parallel (mutmut forks a worker per CPU, and each worker runs
pytest.main). Now and then a session fails at session finish:cleanup_dead_symlinkschecks that a link is dead, then unlinks it, and another session can unlink the same link in-between. This reproduces for me on macOS with pytest 9.1.1 (it takes a few rounds):The fix passes
missing_ok=Truetounlink.I haven't found any already reported issues to that effect.
The problem was identified using a supervised agent, and I have reviewed the code and the test - mutmut does no longer attribute flaky mutant kills to pytest session crashes.