Skip to content

multiple tox instances will clobber the .tox directory when provision_tox_env is used #2515

Open
@masenf

Description

@masenf

When multiple tox instances run at the same time, no lock protects the .tox/.tox environment, and it is easily clobbered, rendering one or more invocations as a failure.

tox.ini

[tox]
skipsdist = True
minversion = 3.6.0
requires = setuptools == 40.6.3

[testenv]
commands =
    python -c "import sys; print(sys.executable)"

tox -rvv -e py3 2>&1 > 1.out & tox -rvv -e py3 2>&1 > 2.out

1.out

using tox.ini: /home/mfurer/minimal/tox.ini (pid 3839747)
  removing /home/mfurer/minimal/.tox/log
could not satisfy requires MissingDependency(<Requirement('setuptools==40.6.3')>)
using tox-3.25.0 from /home/mfurer/.pytools/lib/python3.8/site-packages/tox/__init__.py (pid 3839747)
/home/mfurer/.pytools/bin/python (/home/mfurer/.pytools/bin/python) is {'executable': '/home/mfurer/.pytools/bin/python', 'implementation': 'CPython', 'version_info': [3, 8, 10, 'final', 0], 'version': '3.8.10 (default, Jun 22 2022, 20:18:18) \n[GCC 9.4.0]', 'is_64': True, 'sysplatform': 'linux', 'os_sep': '/', 'extra_version_info': None}
.tox uses /home/mfurer/.pytools/bin/python
.tox start: getenv /home/mfurer/minimal/.tox/.tox
.tox cannot reuse: -r flag
.tox recreate: /home/mfurer/minimal/.tox/.tox
  removing /home/mfurer/minimal/.tox/.tox
setting PATH=/home/mfurer/minimal/.tox/.tox/bin:/home/mfurer/.local/bin:/home/mfurer/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/mfurer/.pytools/bin:/home/mfurer/.pytools/bin
[3839754] /home/mfurer/minimal/.tox$ /home/mfurer/.pytools/bin/python -m virtualenv --no-download --python /home/mfurer/.pytools/bin/python .tox
created virtual environment CPython3.8.10.final.0-64 in 925ms
  creator CPython3Posix(dest=/home/mfurer/minimal/.tox/.tox, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/mfurer/.local/share/virtualenv)
    added seed packages: pip==22.2.2, setuptools==65.3.0, wheel==0.37.1
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
.tox installdeps: setuptools == 40.6.3, tox >= 3.6.0
setting PATH=/home/mfurer/minimal/.tox/.tox/bin:/home/mfurer/.local/bin:/home/mfurer/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/mfurer/.pytools/bin:/home/mfurer/.pytools/bin
[3839777] /home/mfurer/minimal$ /home/mfurer/minimal/.tox/.tox/bin/python -m pip install 'setuptools == 40.6.3' 'tox >= 3.6.0'
Looking in indexes: https://artifactory-ha.west.isilon.com/artifactory/api/pypi/pypi-repo/simple
Collecting setuptools==40.6.3
  Using cached https://artifactory-ha.west.isilon.com/artifactory/api/pypi/pypi-repo/packages/packages/37/06/754589caf971b0d2d48f151c2586f62902d93dc908e2fd9b9b9f6aa3c9dd/setuptools-40.6.3-py2.py3-none-any.whl (573 kB)
Collecting tox>=3.6.0
  Using cached https://artifactory-ha.west.isilon.com/artifactory/api/pypi/pypi-repo/packages/packages/a0/62/4a490d6e064727ced44b2a7897bf3f8cc09fa9443f2ef258ff56973d96e1/tox-3.26.0-py2.py3-none-any.whl (86 kB)
Collecting tomli>=2.0.1
  Using cached https://artifactory-ha.west.isilon.com/artifactory/api/pypi/pypi-repo/packages/packages/97/75/10a9ebee3fd790d20926a90a2547f0bf78f371b2f13aa822c759680ca7b9/tomli-2.0.1-py3-none-any.whl (12 kB)
Collecting pluggy>=0.12.0
  Using cached https://artifactory-ha.west.isilon.com/artifactory/api/pypi/pypi-repo/packages/packages/9e/01/f38e2ff29715251cf25532b9082a1589ab7e4f571ced434f98d0139336dc/pluggy-1.0.0-py2.py3-none-any.whl (13 kB)
Collecting packaging>=14
  Using cached https://artifactory-ha.west.isilon.com/artifactory/api/pypi/pypi-repo/packages/packages/05/8e/8de486cbd03baba4deef4142bd643a3e7bbe954a784dc1bb17142572d127/packaging-21.3-py3-none-any.whl (40 kB)
Collecting filelock>=3.0.0
  Using cached https://artifactory-ha.west.isilon.com/artifactory/api/pypi/pypi-repo/packages/packages/94/b3/ff2845971788613e646e667043fdb5f128e2e540aefa09a3c55be8290d6d/filelock-3.8.0-py3-none-any.whl (10 kB)
Collecting six>=1.14.0
  Using cached https://artifactory-ha.west.isilon.com/artifactory/api/pypi/pypi-repo/packages/packages/d9/5a/e7c31adbe875f2abbb91bd84cf2dc52d792b5a01506781dbcf25c91daf11/six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting py>=1.4.17
  Using cached https://artifactory-ha.west.isilon.com/artifactory/api/pypi/pypi-repo/packages/packages/f6/f0/10642828a8dfb741e5f3fbaac830550a518a775c7fff6f04a007259b0548/py-1.11.0-py2.py3-none-any.whl (98 kB)
Collecting virtualenv!=20.0.0,!=20.0.1,!=20.0.2,!=20.0.3,!=20.0.4,!=20.0.5,!=20.0.6,!=20.0.7,>=16.0.0
  Using cached https://artifactory-ha.west.isilon.com/artifactory/api/pypi/pypi-repo/packages/packages/c1/23/9dc3c3fc959ad442397dd90cbc9ea2eca7c8a140d242c6e4222675ea9f86/virtualenv-20.16.5-py3-none-any.whl (8.8 MB)
Collecting pyparsing!=3.0.5,>=2.0.2
  Using cached https://artifactory-ha.west.isilon.com/artifactory/api/pypi/pypi-repo/packages/packages/6c/10/a7d0fa5baea8fe7b50f448ab742f26f52b80bfca85ac2be9d35cdd9a3246/pyparsing-3.0.9-py3-none-any.whl (98 kB)
Collecting distlib<1,>=0.3.5
  Using cached https://artifactory-ha.west.isilon.com/artifactory/api/pypi/pypi-repo/packages/packages/76/cb/6bbd2b10170ed991cf64e8c8b85e01f2fb38f95d1bc77617569e0b0b26ac/distlib-0.3.6-py2.py3-none-any.whl (468 kB)
Collecting platformdirs<3,>=2.4
  Using cached https://artifactory-ha.west.isilon.com/artifactory/api/pypi/pypi-repo/packages/packages/ed/22/967181c94c3a4063fe64e15331b4cb366bdd7dfbf46fcb8ad89650026fec/platformdirs-2.5.2-py3-none-any.whl (14 kB)
Installing collected packages: distlib, tomli, six, setuptools, pyparsing, py, pluggy, platformdirs, filelock, virtualenv, packaging, tox
  Attempting uninstall: setuptools
    Found existing installation: setuptools 65.3.0
    Uninstalling setuptools-65.3.0:
      Successfully uninstalled setuptools-65.3.0
Successfully installed distlib-0.3.6 filelock-3.8.0 packaging-21.3 platformdirs-2.5.2 pluggy-1.0.0 py-1.11.0 pyparsing-3.0.9 setuptools-40.6.3 six-1.16.0 tomli-2.0.1 tox-3.26.0 virtualenv-20.16.5
.tox finish: getenv /home/mfurer/minimal/.tox/.tox after 5.16 seconds
.tox start: finishvenv
write config to /home/mfurer/minimal/.tox/.tox/.tox-config1 as 'c78dac41792167274ef40c7bc3966e82651aa36138450f6e5f8afd783dd38a81 /home/mfurer/.pytools/bin/python\n3.25.0 0 0 0\n00000000000000000000000000000000 setuptools == 40.6.3\n00000000000000000000000000000000 tox >= 3.6.0'
.tox finish: finishvenv  after 0.02 seconds
.tox start: provision
[3839789] /home/mfurer/minimal$ /home/mfurer/minimal/.tox/.tox/bin/python -m tox -rvv -e py3
using tox.ini: /home/mfurer/minimal/tox.ini (pid 3839789)
using tox-3.26.0 from /home/mfurer/minimal/.tox/.tox/lib/python3.8/site-packages/tox/__init__.py (pid 3839789)
skipping sdist step
py3 uses /home/mfurer/minimal/.tox/.tox/bin/python
py3 start: getenv /home/mfurer/minimal/.tox/py3
py3 cannot reuse: -r flag
py3 recreate: /home/mfurer/minimal/.tox/py3
  removing /home/mfurer/minimal/.tox/py3
setting PATH=/home/mfurer/minimal/.tox/py3/bin:/home/mfurer/.local/bin:/home/mfurer/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/mfurer/.pytools/bin:/home/mfurer/.pytools/bin
[3839795] /home/mfurer/minimal/.tox$ /home/mfurer/minimal/.tox/.tox/bin/python -m virtualenv --no-download --python .tox/bin/python py3
created virtual environment CPython3.8.10.final.0-64 in 191ms
  creator CPython3Posix(dest=/home/mfurer/minimal/.tox/py3, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/mfurer/.local/share/virtualenv)
    added seed packages: pip==22.2.2, setuptools==65.3.0, wheel==0.37.1
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
py3 finish: getenv /home/mfurer/minimal/.tox/py3 after 0.38 seconds
py3 start: finishvenv
write config to /home/mfurer/minimal/.tox/py3/.tox-config1 as 'c78dac41792167274ef40c7bc3966e82651aa36138450f6e5f8afd783dd38a81 /home/mfurer/minimal/.tox/.tox/bin/python\n3.26.0 0 0 0'
py3 finish: finishvenv  after 0.02 seconds
py3 start: envreport
setting PATH=/home/mfurer/minimal/.tox/py3/bin:/home/mfurer/.local/bin:/home/mfurer/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/mfurer/.pytools/bin:/home/mfurer/.pytools/bin
[3839804] /home/mfurer/minimal$ /home/mfurer/minimal/.tox/py3/bin/python -m pip freeze >.tox/py3/log/py3-0.log
py3 finish: envreport  after 0.91 seconds
py3 installed:
py3 start: run-test-pre
py3 run-test-pre: PYTHONHASHSEED='2679986132'
py3 finish: run-test-pre  after 0.00 seconds
py3 start: run-test
py3 run-test: commands[0] | python -c 'import sys; print(sys.executable)'
setting PATH=/home/mfurer/minimal/.tox/py3/bin:/home/mfurer/.local/bin:/home/mfurer/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/mfurer/.pytools/bin:/home/mfurer/.pytools/bin
[3839809] /home/mfurer/minimal$ /home/mfurer/minimal/.tox/py3/bin/python -c 'import sys; print(sys.executable)'
/home/mfurer/minimal/.tox/py3/bin/python
py3 finish: run-test  after 0.02 seconds
py3 start: run-test-post
py3 finish: run-test-post  after 0.00 seconds
___________________________________ summary ____________________________________
  py3: commands succeeded
  congratulations :)
.tox finish: provision  after 1.54 seconds

2.out

using tox.ini: /home/mfurer/minimal/tox.ini (pid 3839748)
  removing /home/mfurer/minimal/.tox/log
could not satisfy requires MissingDependency(<Requirement('setuptools==40.6.3')>)
using tox-3.25.0 from /home/mfurer/.pytools/lib/python3.8/site-packages/tox/__init__.py (pid 3839748)
/home/mfurer/.pytools/bin/python (/home/mfurer/.pytools/bin/python) is {'executable': '/home/mfurer/.pytools/bin/python', 'implementation': 'CPython', 'version_info': [3, 8, 10, 'final', 0], 'version': '3.8.10 (default, Jun 22 2022, 20:18:18) \n[GCC 9.4.0]', 'is_64': True, 'sysplatform': 'linux', 'os_sep': '/', 'extra_version_info': None}
.tox uses /home/mfurer/.pytools/bin/python
.tox start: getenv /home/mfurer/minimal/.tox/.tox
.tox cannot reuse: -r flag
.tox recreate: /home/mfurer/minimal/.tox/.tox
  removing /home/mfurer/minimal/.tox/.tox
setting PATH=/home/mfurer/minimal/.tox/.tox/bin:/home/mfurer/.local/bin:/home/mfurer/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/mfurer/.pytools/bin:/home/mfurer/.pytools/bin
[3839753] /home/mfurer/minimal/.tox$ /home/mfurer/.pytools/bin/python -m virtualenv --no-download --python /home/mfurer/.pytools/bin/python .tox
created virtual environment CPython3.8.10.final.0-64 in 528ms
  creator CPython3Posix(dest=/home/mfurer/minimal/.tox/.tox, clear=False, no_vcs_ignore=False, global=False)
  seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=/home/mfurer/.local/share/virtualenv)
    added seed packages: pip==22.2.2, setuptools==65.3.0, wheel==0.37.1
  activators BashActivator,CShellActivator,FishActivator,NushellActivator,PowerShellActivator,PythonActivator
.tox installdeps: setuptools == 40.6.3, tox >= 3.6.0
setting PATH=/home/mfurer/minimal/.tox/.tox/bin:/home/mfurer/.local/bin:/home/mfurer/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/mfurer/.pytools/bin:/home/mfurer/.pytools/bin
[3839767] /home/mfurer/minimal$ /home/mfurer/minimal/.tox/.tox/bin/python -m pip install 'setuptools == 40.6.3' 'tox >= 3.6.0'
Traceback (most recent call last):
  File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.8/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/mfurer/minimal/.tox/.tox/lib/python3.8/site-packages/pip/__main__.py", line 29, in <module>
    from pip._internal.cli.main import main as _main
  File "/home/mfurer/minimal/.tox/.tox/lib/python3.8/site-packages/pip/_internal/cli/main.py", line 9, in <module>
    from pip._internal.cli.autocompletion import autocomplete
  File "/home/mfurer/minimal/.tox/.tox/lib/python3.8/site-packages/pip/_internal/cli/autocompletion.py", line 10, in <module>
    from pip._internal.cli.main_parser import create_main_parser
  File "/home/mfurer/minimal/.tox/.tox/lib/python3.8/site-packages/pip/_internal/cli/main_parser.py", line 8, in <module>
    from pip._internal.cli import cmdoptions
  File "/home/mfurer/minimal/.tox/.tox/lib/python3.8/site-packages/pip/_internal/cli/cmdoptions.py", line 24, in <module>
    from pip._internal.cli.parser import ConfigOptionParser
  File "/home/mfurer/minimal/.tox/.tox/lib/python3.8/site-packages/pip/_internal/cli/parser.py", line 12, in <module>
    from pip._internal.configuration import Configuration, ConfigurationError
  File "/home/mfurer/minimal/.tox/.tox/lib/python3.8/site-packages/pip/_internal/configuration.py", line 20, in <module>
    from pip._internal.exceptions import (
  File "/home/mfurer/minimal/.tox/.tox/lib/python3.8/site-packages/pip/_internal/exceptions.py", line 13, in <module>
    from pip._vendor.requests.models import Request, Response
  File "/home/mfurer/minimal/.tox/.tox/lib/python3.8/site-packages/pip/_vendor/requests/__init__.py", line 45, in <module>
  File "/home/mfurer/minimal/.tox/.tox/lib/python3.8/site-packages/pip/_vendor/requests/exceptions.py", line 9, in <module>
  File "/home/mfurer/minimal/.tox/.tox/lib/python3.8/site-packages/pip/_vendor/requests/compat.py", line 10, in <module>
  File "/home/mfurer/minimal/.tox/.tox/lib/python3.8/site-packages/pip/_vendor/chardet/__init__.py", line 19, in <module>
  File "/home/mfurer/minimal/.tox/.tox/lib/python3.8/site-packages/pip/_vendor/chardet/universaldetector.py", line 48, in <module>
  File "/home/mfurer/minimal/.tox/.tox/lib/python3.8/site-packages/pip/_vendor/chardet/sbcsgroupprober.py", line 31, in <module>
  File "/home/mfurer/minimal/.tox/.tox/lib/python3.8/site-packages/pip/_vendor/chardet/langbulgarianmodel.py", line 1, in <module>
ModuleNotFoundError: No module named 'pip._vendor.chardet.sbcharsetprober'
ERROR: invocation failed (exit code 1)
ERROR: could not install deps [setuptools == 40.6.3, tox >= 3.6.0]; v = InvocationError("/home/mfurer/minimal/.tox/.tox/bin/python -m pip install 'setuptools == 40.6.3' 'tox >= 3.6.0'", 1)
.tox finish: getenv /home/mfurer/minimal/.tox/.tox after 1.50 seconds
.tox start: provision
[3839775] /home/mfurer/minimal$ /home/mfurer/minimal/.tox/.tox/bin/python -m tox -rvv -e py3
/home/mfurer/minimal/.tox/.tox/bin/python: No module named tox
.tox finish: provision  after 0.03 seconds

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug:normalaffects many people or has quite an impacthelp:wantedIssues that have been acknowledged, a solution determined and a PR might likely be accepted.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions