Fix tmp_path regression introduced in 7.3.0#10911
Merged
nicoddemus merged 6 commits intopytest-dev:mainfrom Apr 14, 2023
Merged
Fix tmp_path regression introduced in 7.3.0#10911nicoddemus merged 6 commits intopytest-dev:mainfrom
nicoddemus merged 6 commits intopytest-dev:mainfrom
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
Member
Author
|
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. |
RonnyPfannschmidt
approved these changes
Apr 14, 2023
Member
|
@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: |
ykadowak
reviewed
Apr 14, 2023
Member
|
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. |
Member
Author
|
Ahh sorry, just saw it now. Anyway I pushed the tags, glad you could work around that. |
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.
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