Skip to content

#7280: increase retry wait for rmtree #7361

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

Closed
wants to merge 2 commits into from

Conversation

choyrim
Copy link

@choyrim choyrim commented Nov 15, 2019

to address #7280 - increase retry wait for rmtree to allow more time for virus scanners to release files on windows.

@@ -366,11 +366,11 @@ def test_rmtree_retries(tmpdir, monkeypatch):
rmtree('foo')


def test_rmtree_retries_for_3sec(tmpdir, monkeypatch):
def test_rmtree_retries_for_12sec(tmpdir, monkeypatch):
Copy link
Member

Choose a reason for hiding this comment

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

Does this test actually last 12 seconds?

Copy link
Author

Choose a reason for hiding this comment

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

yes, sadly.

>tox -e py37 -- tests\unit\test_utils.py
. . .
py37 run-test: commands[0] | pytest --timeout 300 'tests\unit\test_utils.py'
============================= test session starts =============================
platform win32 -- Python 3.7.4, pytest-3.8.2, py-1.8.0, pluggy-0.13.0
. . .
tests\unit\test_utils.py .............................s................. [ 32%]
........................................................................ [ 82%]
..........................                                               [100%]
=========================== short test summary info ===========================
SKIP [1] tests\unit\test_utils.py:400: condition: sys.platform == 'win32'

=================== 144 passed, 1 skipped in 15.06 seconds ====================
_______________________________________________________________ summary _______________________________________________________________
  py37: commands succeeded
  congratulations :)

Copy link
Member

Choose a reason for hiding this comment

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

Ouch. Can we refactor like this:

def rmtree_provider(**kwargs):
    @retry(**kwargs)
    def rmtree(...):
        # as before
        ...

   return rmtree

and just test that it works as expected with 1 or 2 seconds, then set rmtree = rmtree_provider(stop_max_delay=12000, wait_fixed=500) in pip._internal.utils.misc? Then we're free to adjust the time without impacting test duration.

If you want to make that as a separate PR it would help separate this side concern from your overall proposal to move to 12s.

@chrahunt
Copy link
Member

Any problem closing this in favor of #7363?

@choyrim
Copy link
Author

choyrim commented Nov 16, 2019 via email

@chrahunt chrahunt closed this Nov 16, 2019
@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Dec 16, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Dec 16, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants