-
-
Notifications
You must be signed in to change notification settings - Fork 526
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
Tox fails (cannot access file because it is being used by another process (path) ) on 2th test with --installpkg provided #3165
Comments
It is the folder inside of |
Reproduced on my home computer. I even reduced the needed tox file to bare minimum:
I also just spend a good amount of time digging though the testcases and figuring out how i could reproduce it using PyTest.
Actual testcase:
|
@gaborbernat Do you have any idea what could be causing this? |
No idea. |
I did some hacking which allowed the test to pass. First I just deactivated the removal of the
It passes the testcase I mentioned in this Issue. From what I can see there are a few options:
For some reason only the I don't know what is the most correct way of handling this. |
With devpi we have seen similar problems. It seems like subprocesses might still be around for a short time on Windows, even after the subprocess call in Python has returned. We added a retry with a short wait to work directory removal: https://github.com/devpi/devpi/blob/034aa0b21b4b1b00e1bdd6cba5927ef4dbd02347/client/devpi/main.py#L226 Also see devpi/devpi#913 |
@fschulze Thanks for leaving your comment. |
PR to fix it welcome. |
I think creating the folder once and not removing after test run of an env sounds like the correct solution when compared to everything else tox does in other cases. I don't see how removing it helps with test isolation or anything like it and duplicating it also seems wasteful. I still wonder what is still accessing it though. |
@fschulze Noted. |
Disabled cleaning of .sdist-extract folder and added testcase to catch issue caused by feature.
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Tested and now works! |
Issue
Hello,
I have found a case where running devpi on Windows-only it canfail.
I managerd to narrow it down to tox with
--installpkg
argument causes Tox to fail. I managed to reproduce it with Tox alone by just writing the bare minimum commands.It fails between
ToxEnv._setup_env
andToxEnv._setup_with_env
on the 2th run so if only having one env in Tox then it works.Environment
Provide at least:
Output of
pip list
of the host Python, wheretox
is installedOutput of running tox
Output of
tox -rvv
Minimal example
files:
test_tox.zip
Download files from issue
open command console and enter folder
run
tox --installpkg dist\my_package-0.0.0.tar.gz -c ./tox.ini
See output added above (tox --rvv)
The text was updated successfully, but these errors were encountered: