-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Fix tmp_path regression introduced in 7.3.0 #10911
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The problem is that we would loop over all directories of the basetemp directory searching for dead symlinks, for each test, which would compound over the test session run. Doing the cleanup just once, at the end of the session, fixes the problem. Fix pytest-dev#10896
To test this, I wrote this file: import pytest
DATA = "0" * 1 * 1024 * 1024
@pytest.mark.parametrize("i", range(2000))
def test1(tmp_path, i):
tmp_path.joinpath("hello.txt").write_text(DATA) In
(You can see each test taking longer and longer). In this branch I get:
I couldn't think of a test for this, given the regression is circumstantial. |
@nicoddemus Any chance you could push the tags to your repo so I can easily test this? Right now I get:
Something like this should do:
|
I got it to work via Seems to work fine, thanks for the investigation and fix! Down from 1h 5min to 24 minutes again now. |
Ahh sorry, just saw it now. Anyway I pushed the tags, glad you could work around that. |
The problem is that we would loop over all directories of the basetemp directory searching for dead symlinks, for each test, which would compound over the test session run.
Doing the cleanup just once, at the end of the session, fixes the problem.
Fix #10896