Skip to content
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

test_sequential/demo_package_inline seems flaky when paralelized (pytest -n auto) #2985

Closed
hroncok opened this issue Apr 12, 2023 · 3 comments · Fixed by #2986
Closed

test_sequential/demo_package_inline seems flaky when paralelized (pytest -n auto) #2985

hroncok opened this issue Apr 12, 2023 · 3 comments · Fixed by #2986

Comments

@hroncok
Copy link
Contributor

hroncok commented Apr 12, 2023

Issue

I've observed the following test failures of tox (4.4.11 or main @ ea169d0):

[tox (main)]$ rm tests/demo_pkg_inline/.tox/ -rf && tox -e py311 -- -n=auto --run-integration tests/session/cmd/test_sequential.py
py311 inst-nodeps: .../tox/.tox/.tmp/package/1/tox-4.4.11.tar.gz
py311 installed: aiohttp==3.8.4,aiosignal==1.3.1,argon2-cffi==21.3.0,argon2-cffi-bindings==21.2.0,async-timeout==4.0.2,attrs==22.2.0,build==0.10.0,cachetools==5.3.0,certifi==2022.12.7,cffi==1.15.1,chardet==5.1.0,charset-normalizer==3.1.0,check-manifest==0.49,colorama==0.4.6,covdefaults==2.3.0,coverage==7.2.3,defusedxml==0.7.1,devpi-client==6.0.3,devpi-common==3.7.0,devpi-process==0.3.0,devpi-server==6.8.0,diff-cover==7.5.0,distlib==0.3.6,editables==0.3,execnet==1.9.0,filelock==3.11.0,flaky==3.7.0,frozenlist==1.3.3,hatch-vcs==0.3.0,hatchling==1.14.0,hupper==1.12,idna==3.4,iniconfig==2.0.0,itsdangerous==2.1.2,Jinja2==3.1.2,lazy==1.5,MarkupSafe==2.1.2,multidict==6.0.4,packaging==23.1,passlib==1.7.4,PasteDeploy==3.0.1,pathspec==0.11.1,pep517==0.13.0,pkginfo==1.9.6,plaster==1.1.2,plaster-pastedeploy==1.0.1,platformdirs==3.2.0,pluggy==1.0.0,psutil==5.9.4,py==1.11.0,pycparser==2.21,Pygments==2.15.0,pyproject_api==1.5.1,pyproject_hooks==1.0.0,pyramid==2.0.1,pytest==7.3.0,pytest-cov==4.0.0,pytest-mock==3.10.0,pytest-xdist==3.2.1,python-dateutil==2.8.2,re-assert==1.1.0,regex==2023.3.23,repoze.lru==0.7,requests==2.28.2,ruamel.yaml==0.17.21,setuptools-scm==7.1.0,six==1.16.0,strictyaml==1.7.3,time-machine==2.9.0,tox @ file://.../tox/.tox/.tmp/package/1/tox-4.4.11.tar.gz,translationstring==1.4,trove-classifiers==2023.3.9,typing_extensions==4.5.0,urllib3==1.26.15,venusian==3.0.0,virtualenv==20.21.0,waitress==2.1.2,WebOb==1.8.7,yarl==1.8.2,zope.deprecation==5.0,zope.interface==6.0
py311 run-test-pre: PYTHONHASHSEED='2384514533'
py311 run-test: commands[0] | pytest -n=auto --run-integration tests/session/cmd/test_sequential.py
============================================== test session starts ==============================================
platform linux -- Python 3.11.3, pytest-7.3.0, pluggy-1.0.0
cachedir: .tox/py311/.pytest_cache
rootdir: .../tox
configfile: pyproject.toml
plugins: time-machine-2.9.0, flaky-3.7.0, xdist-3.2.1, mock-3.10.0, cov-4.0.0, devpi-server-6.8.0
gw0 [33] / gw1 [33] / gw2 [33] / gw3 [33]
.............................FF..                                                                         [100%]
=================================================== FAILURES ====================================================
____________________________________ test_sequential_clears_pkg_at_most_once ____________________________________
[gw0] linux -- Python 3.11.3 .../tox/.tox/py311/bin/python

tox_project = <function init_fixture.<locals>._init at 0x7f02ff3439c0>
demo_pkg_inline = PosixPath('.../tox/tests/demo_pkg_inline')

    def test_sequential_clears_pkg_at_most_once(tox_project: ToxProjectCreator, demo_pkg_inline: Path) -> None:
        project = tox_project({"tox.ini": ""})
        result = project.run("r", "--root", str(demo_pkg_inline), "-e", "a,b", "-r")
>       result.assert_success()

demo_pkg_inline = PosixPath('.../tox/tests/demo_pkg_inline')
project    = ToxProject(path=/tmp/pytest-of-churchyard/pytest-50/popen-gw0/test_sequential_clears_pkg_at_0/p) at 139650797147088
result     = code: -1
cmd: .../tox/.tox/py311/bin/python -m tox r --root /home/churchyard/Dokumenty/R...pi/_backend.py True build
  a: OK (0.72 seconds)
  b: FAIL code 2 (0.02 seconds)
  evaluation failed :( (0.75 seconds)

tox_project = <function init_fixture.<locals>._init at 0x7f02ff3439c0>

tests/session/cmd/test_sequential.py:423: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = code: -1
cmd: .../tox/.tox/py311/bin/python -m tox r --root /home/churchyard/Dokumenty/R...pi/_backend.py True build
  a: OK (0.72 seconds)
  b: FAIL code 2 (0.02 seconds)
  evaluation failed :( (0.75 seconds)


    def assert_success(self) -> None:
>       assert self.success, repr(self)
E       AssertionError: code: -1
E         cmd: .../tox/.tox/py311/bin/python -m tox r --root .../tox/tests/demo_pkg_inline -e a,b -r
E         cwd: /tmp/pytest-of-churchyard/pytest-50/popen-gw0/test_sequential_clears_pkg_at_0/p
E         standard output
E         .pkg: remove tox env folder .../tox/tests/demo_pkg_inline/.tox/.pkg
E         .pkg: _optional_hooks .../tox/tests/demo_pkg_inline> python .../tox/.tox/py311/lib/python3.11/site-packages/pyproject_api/_backend.py True build
E         .pkg: get_requires_for_build_sdist .../tox/tests/demo_pkg_inline> python .../tox/.tox/py311/lib/python3.11/site-packages/pyproject_api/_backend.py True build
E         .pkg: build_wheel .../tox/tests/demo_pkg_inline> python .../tox/.tox/py311/lib/python3.11/site-packages/pyproject_api/_backend.py True build
E         .pkg: build_sdist .../tox/tests/demo_pkg_inline> python .../tox/.tox/py311/lib/python3.11/site-packages/pyproject_api/_backend.py True build
E         a: install_package .../tox/tests/demo_pkg_inline> python -I -m pip install --force-reinstall --no-deps .../tox/tests/demo_pkg_inline/.tox/.tmp/package/3/demo_pkg_inline-1.0.0.tar.gz
E         a: OK ✔ in 0.72 seconds
E         b: internal error
E         Traceback (most recent call last):
E           File ".../tox/.tox/py311/lib/python3.11/site-packages/tox/session/cmd/run/single.py", line 45, in _evaluate
E             tox_env.setup()
E           File ".../tox/.tox/py311/lib/python3.11/site-packages/tox/tox_env/api.py", line 250, in setup
E             self._setup_with_env()
E           File ".../tox/.tox/py311/lib/python3.11/site-packages/tox/tox_env/runner.py", line 143, in _setup_with_env
E             self._setup_pkg()
E           File ".../tox/.tox/py311/lib/python3.11/site-packages/tox/tox_env/runner.py", line 166, in _setup_pkg
E             self._packages = self._build_packages()
E                              ^^^^^^^^^^^^^^^^^^^^^^
E           File ".../tox/.tox/py311/lib/python3.11/site-packages/tox/tox_env/python/runner.py", line 118, in _build_packages
E             packages = package_env.perform_packaging(self.conf)
E                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E           File ".../tox/.tox/py311/lib/python3.11/site-packages/tox/tox_env/package.py", line 47, in _func
E             return meth(*args, **kwargs)
E                    ^^^^^^^^^^^^^^^^^^^^^
E           File ".../tox/.tox/py311/lib/python3.11/site-packages/tox/tox_env/python/virtual_env/package/pyproject.py", line 207, in perform_packaging
E             sdist = create_session_view(sdist, self._package_temp_path)
E                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
E           File ".../tox/.tox/py311/lib/python3.11/site-packages/tox/util/file_view.py", line 32, in create_session_view
E             shutil.copyfile(package, session_package)
E           File "/usr/lib64/python3.11/shutil.py", line 256, in copyfile
E             with open(src, 'rb') as fsrc:
E                  ^^^^^^^^^^^^^^^
E         FileNotFoundError: [Errno 2] No such file or directory: '.../tox/tests/demo_pkg_inline/.tox/.pkg/dist/demo_pkg_inline-1.0.0.tar.gz'
E         .pkg: _exit .../tox/tests/demo_pkg_inline> python .../tox/.tox/py311/lib/python3.11/site-packages/pyproject_api/_backend.py True build
E           a: OK (0.72 seconds)
E           b: FAIL code 2 (0.02 seconds)
E           evaluation failed :( (0.75 seconds)
E         
E       assert False
E        +  where False = code: -1\ncmd: .../tox/.tox/py311/bin/python -m tox r --root /home/churchyard/Dokumenty/R...pi/_backend.py True build\n  a: OK (0.72 seconds)\n  b: FAIL code 2 (0.02 seconds)\n  evaluation failed :( (0.75 seconds)\n.success

self       = code: -1
cmd: .../tox/.tox/py311/bin/python -m tox r --root /home/churchyard/Dokumenty/R...pi/_backend.py True build
  a: OK (0.72 seconds)
  b: FAIL code 2 (0.02 seconds)
  evaluation failed :( (0.75 seconds)


.tox/py311/lib/python3.11/site-packages/tox/pytest.py:353: AssertionError
__________________________________________ test_rerun_sequential_sdist __________________________________________
[gw0] linux -- Python 3.11.3 .../tox/.tox/py311/bin/python

tox_project = <function init_fixture.<locals>._init at 0x7f02ff343920>
demo_pkg_inline = PosixPath('.../tox/tests/demo_pkg_inline')

    @pytest.mark.integration()
    def test_rerun_sequential_sdist(tox_project: ToxProjectCreator, demo_pkg_inline: Path) -> None:
        proj = tox_project(
            {"tox.ini": "[testenv]\npackage=sdist\ncommands=python -c 'from demo_pkg_inline import do; do()'"},
        )
        result_first = proj.run("--root", str(demo_pkg_inline))
>       result_first.assert_success()

demo_pkg_inline = PosixPath('.../tox/tests/demo_pkg_inline')
proj       = ToxProject(path=/tmp/pytest-of-churchyard/pytest-50/popen-gw0/test_rerun_sequential_sdist0/p) at 139650848823696
result_first = code: 1
cmd: .../tox/.tox/py311/bin/python -m tox --root ...s/pip/_internal/build_env.py", line 21, in <module>
ModuleNotFoundError: No module named 'pip._internal.metadata'

tox_project = <function init_fixture.<locals>._init at 0x7f02ff343920>

tests/session/cmd/test_sequential.py:154: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = code: 1
cmd: .../tox/.tox/py311/bin/python -m tox --root ...s/pip/_internal/build_env.py", line 21, in <module>
ModuleNotFoundError: No module named 'pip._internal.metadata'


    def assert_success(self) -> None:
>       assert self.success, repr(self)
E       AssertionError: code: 1
E         cmd: .../tox/.tox/py311/bin/python -m tox --root .../tox/tests/demo_pkg_inline
E         cwd: /tmp/pytest-of-churchyard/pytest-50/popen-gw0/test_rerun_sequential_sdist0/p
E         standard output
E         .pkg: _optional_hooks .../tox/tests/demo_pkg_inline> python .../tox/.tox/py311/lib/python3.11/site-packages/pyproject_api/_backend.py True build
E         .pkg: get_requires_for_build_sdist .../tox/tests/demo_pkg_inline> python .../tox/.tox/py311/lib/python3.11/site-packages/pyproject_api/_backend.py True build
E         .pkg: build_wheel .../tox/tests/demo_pkg_inline> python .../tox/.tox/py311/lib/python3.11/site-packages/pyproject_api/_backend.py True build
E         .pkg: build_sdist .../tox/tests/demo_pkg_inline> python .../tox/.tox/py311/lib/python3.11/site-packages/pyproject_api/_backend.py True build
E         py: install_package .../tox/tests/demo_pkg_inline> python -I -m pip install --force-reinstall --no-deps .../tox/tests/demo_pkg_inline/.tox/.tmp/package/6/demo_pkg_inline-1.0.0.tar.gz
E         py: exit 1 (0.27 seconds) .../tox/tests/demo_pkg_inline> python -I -m pip install --force-reinstall --no-deps .../tox/tests/demo_pkg_inline/.tox/.tmp/package/6/demo_pkg_inline-1.0.0.tar.gz pid=2323852
E         .pkg: _exit .../tox/tests/demo_pkg_inline> python .../tox/.tox/py311/lib/python3.11/site-packages/pyproject_api/_backend.py True build
E           py: FAIL code 1 (0.39 seconds)
E           evaluation failed :( (0.42 seconds)
E         
E         standard error
E         Traceback (most recent call last):
E           File "<frozen runpy>", line 198, in _run_module_as_main
E           File "<frozen runpy>", line 88, in _run_code
E           File ".../tox/tests/demo_pkg_inline/.tox/py/lib/python3.11/site-packages/pip/__main__.py", line 29, in <module>
E           File ".../tox/tests/demo_pkg_inline/.tox/py/lib/python3.11/site-packages/pip/_internal/cli/main.py", line 9, in <module>
E           File ".../tox/tests/demo_pkg_inline/.tox/py/lib/python3.11/site-packages/pip/_internal/cli/autocompletion.py", line 10, in <module>
E           File ".../tox/tests/demo_pkg_inline/.tox/py/lib/python3.11/site-packages/pip/_internal/cli/main_parser.py", line 9, in <module>
E           File ".../tox/tests/demo_pkg_inline/.tox/py/lib/python3.11/site-packages/pip/_internal/build_env.py", line 21, in <module>
E         ModuleNotFoundError: No module named 'pip._internal.metadata'
E         
E       assert False
E        +  where False = code: 1\ncmd: .../tox/.tox/py311/bin/python -m tox --root ...s/pip/_internal/build_env.py", line 21, in <module>\nModuleNotFoundError: No module named 'pip._internal.metadata'\n.success

self       = code: 1
cmd: .../tox/.tox/py311/bin/python -m tox --root ...s/pip/_internal/build_env.py", line 21, in <module>
ModuleNotFoundError: No module named 'pip._internal.metadata'


.tox/py311/lib/python3.11/site-packages/tox/pytest.py:353: AssertionError
============================================ short test summary info ============================================
FAILED tests/session/cmd/test_sequential.py::test_sequential_clears_pkg_at_most_once - AssertionError: code: -1
FAILED tests/session/cmd/test_sequential.py::test_rerun_sequential_sdist - AssertionError: code: 1
========================================= 2 failed, 31 passed in 4.84s ==========================================
ERROR: InvocationError for command .../tox/.tox/py311/bin/pytest -n=auto --run-integration tests/session/cmd/test_sequential.py (exited with code 1)
____________________________________________________ summary ____________________________________________________
ERROR:   py311: commands failed

This only happens sometimes and depends on how xdist schedules the tests. Sometimes 2 tests fails, sometimes 1, sometimes they pass.

$ while true; do rm tests/demo_pkg_inline/.tox/ -rf && tox -e py311 -- -n=auto --run-integration tests/session/cmd/test_sequential.py | grep -F 'FAILED tests/session/cmd/test_sequential.py' || echo OK; echo; done
FAILED tests/session/cmd/test_sequential.py::test_sequential_clears_pkg_at_most_once
FAILED tests/session/cmd/test_sequential.py::test_rerun_sequential_sdist - As...

FAILED tests/session/cmd/test_sequential.py::test_sequential_clears_pkg_at_most_once
FAILED tests/session/cmd/test_sequential.py::test_rerun_sequential_sdist - As...

FAILED tests/session/cmd/test_sequential.py::test_sequential_clears_pkg_at_most_once
FAILED tests/session/cmd/test_sequential.py::test_rerun_sequential_sdist - As...

FAILED tests/session/cmd/test_sequential.py::test_sequential_clears_pkg_at_most_once
FAILED tests/session/cmd/test_sequential.py::test_rerun_sequential_sdist - As...

FAILED tests/session/cmd/test_sequential.py::test_rerun_sequential_sdist - As...
FAILED tests/session/cmd/test_sequential.py::test_sequential_clears_pkg_at_most_once

FAILED tests/session/cmd/test_sequential.py::test_sequential_clears_pkg_at_most_once
FAILED tests/session/cmd/test_sequential.py::test_rerun_sequential_sdist - As...

FAILED tests/session/cmd/test_sequential.py::test_sequential_clears_pkg_at_most_once
FAILED tests/session/cmd/test_sequential.py::test_rerun_sequential_sdist - As...

FAILED tests/session/cmd/test_sequential.py::test_sequential_clears_pkg_at_most_once

FAILED tests/session/cmd/test_sequential.py::test_rerun_sequential_sdist - As...

FAILED tests/session/cmd/test_sequential.py::test_sequential_clears_pkg_at_most_once

FAILED tests/session/cmd/test_sequential.py::test_sequential_clears_pkg_at_most_once
FAILED tests/session/cmd/test_sequential.py::test_rerun_sequential_sdist - As...

FAILED tests/session/cmd/test_sequential.py::test_sequential_clears_pkg_at_most_once
FAILED tests/session/cmd/test_sequential.py::test_rerun_sequential_sdist - As...

FAILED tests/session/cmd/test_sequential.py::test_rerun_sequential_sdist - Ke...

OK

FAILED tests/session/cmd/test_sequential.py::test_sequential_clears_pkg_at_most_once
FAILED tests/session/cmd/test_sequential.py::test_rerun_sequential_sdist - As...

...

When the full test suite runs, other tests using the same demo project, such as test_pyproject_deps_from_static[deps_with_circular_recursive_extra] from tests/tox_env/python/virtual_env/package/test_package_pyproject.py, sometimes failed for me as well, with similar errors.

Depending on the -n value, this happens more or less often. Auto means 4 when I run this. It does not (seem to) happen when the tests run without -n=auto or when I set -n=1.

My assumption is that when multiple tox instances run in the demo_package_inline directory in parallel, they create race conditions. I wonder if the demo_package_inline fixture should prevent parallel usage or if it should copy itself into tmp_path each time.

Environment

Provide at least:

  • OS: Fedora Linux 37 or 39
  • pip list of the host Python where tox is installed:
Package              Version
-------------------- ---------
aiohttp              3.8.4
aiosignal            1.3.1
argon2-cffi          21.3.0
argon2-cffi-bindings 21.2.0
async-timeout        4.0.2
attrs                22.2.0
build                0.10.0
cachetools           5.3.0
certifi              2022.12.7
cffi                 1.15.1
chardet              5.1.0
charset-normalizer   3.1.0
check-manifest       0.49
colorama             0.4.6
covdefaults          2.3.0
coverage             7.2.3
defusedxml           0.7.1
devpi-client         6.0.3
devpi-common         3.7.0
devpi-process        0.3.0
devpi-server         6.8.0
diff-cover           7.5.0
distlib              0.3.6
editables            0.3
execnet              1.9.0
filelock             3.11.0
flaky                3.7.0
frozenlist           1.3.3
hatch-vcs            0.3.0
hatchling            1.14.0
hupper               1.12
idna                 3.4
iniconfig            2.0.0
itsdangerous         2.1.2
Jinja2               3.1.2
lazy                 1.5
MarkupSafe           2.1.2
multidict            6.0.4
packaging            23.1
passlib              1.7.4
PasteDeploy          3.0.1
pathspec             0.11.1
pep517               0.13.0
pip                  23.0.1
pkginfo              1.9.6
plaster              1.1.2
plaster-pastedeploy  1.0.1
platformdirs         3.2.0
pluggy               1.0.0
psutil               5.9.4
py                   1.11.0
pycparser            2.21
Pygments             2.15.0
pyproject_api        1.5.1
pyproject_hooks      1.0.0
pyramid              2.0.1
pytest               7.3.0
pytest-cov           4.0.0
pytest-mock          3.10.0
pytest-xdist         3.2.1
python-dateutil      2.8.2
re-assert            1.1.0
regex                2023.3.23
repoze.lru           0.7
requests             2.28.2
ruamel.yaml          0.17.21
setuptools           65.6.3
setuptools-scm       7.1.0
six                  1.16.0
strictyaml           1.7.3
time-machine         2.9.0
tox                  4.4.11
translationstring    1.4
trove-classifiers    2023.3.9
typing_extensions    4.5.0
urllib3              1.26.15
venusian             3.0.0
virtualenv           20.21.0
waitress             2.1.2
WebOb                1.8.7
wheel                0.40.0
yarl                 1.8.2
zope.deprecation     5.0
zope.interface       6.0
@hroncok
Copy link
Contributor Author

hroncok commented Apr 13, 2023

More examples from the Fedora build log:

______________________ test_parallel_show_output_with_pkg ______________________
[gw5] linux -- Python 3.11.3 /usr/bin/python3
tox_project = <function init_fixture.<locals>._init at 0x7fff7873cf40>
demo_pkg_inline = PosixPath('/builddir/build/BUILD/tox-4.4.11/tests/demo_pkg_inline')
    def test_parallel_show_output_with_pkg(tox_project: ToxProjectCreator, demo_pkg_inline: Path) -> None:
        ini = "[testenv]\nparallel_show_output=True\ncommands=python -c 'print(\"r {env_name}\")'"
        project = tox_project({"tox.ini": ini})
>       result = project.run("p", "--root", str(demo_pkg_inline))
demo_pkg_inline = PosixPath('/builddir/build/BUILD/tox-4.4.11/tests/demo_pkg_inline')
ini        = '[testenv]\nparallel_show_output=True\ncommands=python -c \'print("r {env_name}")\''
project    = ToxProject(path=/tmp/pytest-of-mockbuild/pytest-1/popen-gw5/test_parallel_show_output_with0/p) at 140735214293008
tox_project = <function init_fixture.<locals>._init at 0x7fff7873cf40>
tests/session/cmd/test_parallel.py:113: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/pytest.py:292: in run
    tox_run(args)
        args       = ('p', '--root', '/builddir/build/BUILD/tox-4.4.11/tests/demo_pkg_inline')
        code       = None
        from_cwd   = None
        m          = <_pytest.monkeypatch.MonkeyPatch object at 0x7fff7874b250>
        our_setup_state = <function ToxProject.run.<locals>.our_setup_state at 0x7fff7873cc20>
        self       = ToxProject(path=/tmp/pytest-of-mockbuild/pytest-1/popen-gw5/test_parallel_show_output_with0/p) at 140735214293008
        state      = <tox.session.state.State object at 0x7fff79dfdd90>
../../BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/run.py:19: in run
    result = main(sys.argv[1:] if args is None else args)
        args       = ('p', '--root', '/builddir/build/BUILD/tox-4.4.11/tests/demo_pkg_inline')
../../BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/run.py:45: in main
    result = handler(state)
        args       = ('p', '--root', '/builddir/build/BUILD/tox-4.4.11/tests/demo_pkg_inline')
        handler    = <function run_parallel at 0x7fff7a46f600>
        provision  = <function provision at 0x7fff7a3e8fe0>
        result     = False
        state      = <tox.session.state.State object at 0x7fff79dfdd90>
../../BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/session/cmd/run/parallel.py:77: in run_parallel
    return execute(
        option     = Parsed(colored='no', verbose=2, quiet=0, exit_and_dump_after=0, config_file=None, work_dir=None, root_dir=PosixPath('/...pkg=False, skip_pkg_install=False, parallel=8, parallel_live=False, parallel_no_spinner=False, start=1244803.554914268)
        state      = <tox.session.state.State object at 0x7fff79dfdd90>
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
state = <tox.session.state.State object at 0x7fff79dfdd90>, max_workers = 8
has_spinner = True, live = False
    def execute(state: State, max_workers: int | None, has_spinner: bool, live: bool) -> int:
        interrupt, done = Event(), Event()
        results: list[ToxEnvRunResult] = []
        future_to_env: dict[Future[ToxEnvRunResult], ToxEnv] = {}
        state.envs.ensure_only_run_env_is_active()
        to_run_list: list[str] = list(state.envs.iter())
        for name in to_run_list:
            cast(RunToxEnv, state.envs[name]).mark_active()
        previous, has_previous = None, False
        try:
            spinner = ToxSpinner(has_spinner, state, len(to_run_list))
            thread = Thread(
                target=_queue_and_wait,
                name="tox-interrupt",
                args=(state, to_run_list, results, future_to_env, interrupt, done, max_workers, spinner, live),
            )
            thread.start()
            try:
                thread.join()
            except KeyboardInterrupt:
                previous, has_previous = signal(SIGINT, Handlers.SIG_IGN), True
                spinner.print_report = False  # no need to print reports at this point, final report coming up
                logger.error(f"[{os.getpid()}] KeyboardInterrupt - teardown started")
                interrupt.set()
                # cancel in reverse order to not allow submitting new jobs as we cancel running ones
                for future, tox_env in reversed(list(future_to_env.items())):
                    cancelled = future.cancel()
                    # if cannot be cancelled and not done -> still runs
                    if cancelled is False and not future.done():  # pragma: no branch
                        tox_env.interrupt()
                done.wait()
                # workaround for https://bugs.python.org/issue45274
                lock = getattr(thread, "_tstate_lock", None)
                if lock is not None and lock.locked():  # pragma: no branch
                    lock.release()  # pragma: no cover
                    thread._stop()  # type: ignore  # pragma: no cover # calling private method to fix thread state
                thread.join()
        finally:
            ordered_results: list[ToxEnvRunResult] = []
            name_to_run = {r.name: r for r in results}
            for env in to_run_list:
>               ordered_results.append(name_to_run[env])
E               KeyError: 'py'
done       = <threading.Event at 0x7fff79f5ccd0: set>
env        = 'py'
future_to_env = {}
has_previous = False
has_spinner = True
interrupt  = <threading.Event at 0x7fff7872b890: unset>
live       = False
max_workers = 8
name       = 'py'
name_to_run = {}
ordered_results = []
previous   = None
results    = []
spinner    = <tox.session.cmd.run.common.ToxSpinner object at 0x7fff78703810>
state      = <tox.session.state.State object at 0x7fff79dfdd90>
thread     = <Thread(tox-interrupt, stopped 140735088816416)>
to_run_list = ['py']
../../BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/session/cmd/run/common.py:252: KeyError
----------------------------- Captured stdout call -----------------------------


⠋ [0/1]

⠙ [1/1] py

⠹ [1/1] py

⠸ [1/1] py

⠼ [1/1] py

⠴ [1/1] py

⠦ [1/1] py

⠧ [1/1] py

⠇ [1/1] py

⠏ [1/1] py

⠋ [1/1] py

⠙ [1/1] py

⠹ [1/1] py

⠸ [1/1] py

⠼ [1/1] py

⠴ [1/1] py

⠦ [1/1] py

⠧ [1/1] py

⠇ [1/1] py

⠏ [1/1] py

⠋ [1/1] py

⠙ [1/1] py

⠹ [1/1] py

⠸ [1/1] py

⠼ [1/1] py

⠴ [1/1] py

⠦ [1/1] py

⠧ [1/1] py

⠇ [1/1] py

⠏ [1/1] py

⠋ [1/1] py

⠙ [1/1] py

⠹ [1/1] py

⠸ [1/1] py

⠼ [1/1] py

⠴ [1/1] py

⠦ [1/1] py

⠧ [1/1] py

⠇ [1/1] py

⠏ [1/1] py

⠋ [1/1] py

⠙ [1/1] py

⠹ [1/1] py

⠸ [1/1] py

⠼ [1/1] py

⠴ [1/1] py

⠦ [1/1] py

⠧ [1/1] py

⠇ [1/1] py

⠏ [1/1] py

⠋ [1/1] py

⠙ [1/1] py

⠹ [1/1] py

⠸ [1/1] py

⠼ [1/1] py

⠴ [1/1] py

⠦ [1/1] py

⠧ [1/1] py

⠇ [1/1] py

⠏ [1/1] py

⠋ [1/1] py

⠙ [1/1] py

⠹ [1/1] py

⠸ [1/1] py

⠼ [1/1] py

⠴ [1/1] py

⠦ [1/1] py

⠧ [1/1] py

⠇ [1/1] py

⠏ [1/1] py

⠋ [1/1] py

⠙ [1/1] py

⠹ [1/1] py

⠸ [1/1] py

⠼ [1/1] py

⠴ [1/1] py

⠦ [1/1] py

⠧ [1/1] py

⠇ [1/1] py

⠏ [1/1] py

⠋ [1/1] py

⠙ [1/1] py

⠹ [1/1] py

⠸ [1/1] py

⠼ [1/1] py

⠴ [1/1] py

⠦ [1/1] py

⠧ [1/1] py

⠇ [1/1] py

⠏ [1/1] py

⠋ [1/1] py

⠙ [1/1] py

⠹ [1/1] py

⠸ [1/1] py

⠼ [1/1] py

⠴ [1/1] py

⠦ [1/1] py

⠧ [1/1] py

⠇ [1/1] py

⠏ [1/1] py

⠋ [1/1] py

⠙ [1/1] py

⠹ [1/1] py

⠸ [1/1] pyROOT: Internal Error
Traceback (most recent call last):
  File "/builddir/build/BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/session/cmd/run/common.py", line 331, in _queue_and_wait
    result = future.result()
             ^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/concurrent/futures/_base.py", line 449, in result
    return self.__get_result()
           ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/concurrent/futures/_base.py", line 401, in __get_result
    raise self._exception
  File "/usr/lib64/python3.11/concurrent/futures/thread.py", line 58, in run
    result = self.fn(*self.args, **self.kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/session/cmd/run/common.py", line 304, in _run
    return run_one(
           ^^^^^^^^
  File "/builddir/build/BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/session/cmd/run/single.py", line 34, in run_one
    skipped, code, outcomes = _evaluate(tox_env, no_test)
                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/session/cmd/run/single.py", line 61, in _evaluate
    tox_env.teardown()
  File "/builddir/build/BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/tox_env/api.py", line 265, in teardown
    self._teardown()
  File "/builddir/build/BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/tox_env/runner.py", line 83, in _teardown
    self._call_pkg_envs("teardown_env", self.conf)
  File "/builddir/build/BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/tox_env/runner.py", line 116, in _call_pkg_envs
    getattr(package_env, method_name)(*args)
  File "/builddir/build/BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/tox_env/package.py", line 47, in _func
    return meth(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/tox_env/package.py", line 103, in teardown_env
    self._teardown()
  File "/builddir/build/BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/tox_env/package.py", line 47, in _func
    return meth(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/tox_env/python/virtual_env/package/pyproject.py", line 172, in _teardown
    self._frontend._send("_exit")  # try first on amicable shutdown
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/tox_env/python/virtual_env/package/pyproject.py", line 347, in _send
    return super()._send(cmd, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/site-packages/pyproject_api/_frontend.py", line 489, in _send
    with self._send_msg(cmd, result_file, msg) as status:
  File "/usr/lib64/python3.11/contextlib.py", line 144, in __exit__
    next(self.gen)
  File "/builddir/build/BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/tox_env/python/virtual_env/package/pyproject.py", line 358, in _send_msg
    with self._tox_env.execute_async(
  File "/usr/lib64/python3.11/contextlib.py", line 144, in __exit__
    next(self.gen)
  File "/builddir/build/BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/tox_env/api.py", line 444, in execute_async
    self._log_execute(request, execute_status)
  File "/builddir/build/BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/tox_env/package.py", line 47, in _func
    return meth(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/builddir/build/BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/tox_env/api.py", line 450, in _log_execute
    self._write_execute_log(self.name, self.env_log_dir / f"{self._log_id}-{request.run_id}.log", request, status)
  File "/builddir/build/BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/tox_env/api.py", line 454, in _write_execute_log
    with log_file.open("wt", encoding="utf-8") as file:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.11/pathlib.py", line 1044, in open
    return io.open(self, mode, buffering, encoding, errors, newline)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/builddir/build/BUILD/tox-4.4.11/tests/demo_pkg_inline/.tox/.pkg/log/5-_exit.log'

_____ test_pyproject_deps_from_static[deps_with_circular_recursive_extra] ______
[gw0] linux -- Python 3.11.3 /usr/bin/python3
tox_project = <function init_fixture.<locals>._init at 0x7fff9c41e840>
demo_pkg_inline = PosixPath('/builddir/build/BUILD/tox-4.4.11/tests/demo_pkg_inline')
conf = "\n[project]\nname='foo'\noptional-dependencies.alpha=['foo[beta]', 'A']\noptional-dependencies.beta=['foo[alpha]', 'B']"
extra = 'alpha', deps = ['A', 'B']
    @pytest.mark.parametrize(
        ("conf", "extra", "deps"),
        [
            pytest.param("[project]", "", [], id="no_deps"),
            pytest.param("[project]", "alpha", [], id="no_deps_with_extra"),
            pytest.param("[project]\ndependencies=['B', 'A']", "", ["A", "B"], id="deps"),
            pytest.param(
                "[project]\ndependencies=['A']\noptional-dependencies.alpha=['B']\noptional-dependencies.beta=['C']",
                "alpha",
                ["A", "B"],
                id="deps_with_one_extra",
            ),
            pytest.param(
                "[project]\ndependencies=['A']\noptional-dependencies.alpha=['B']\noptional-dependencies.beta=['C']",
                "alpha,beta",
                ["A", "B", "C"],
                id="deps_with_two_extra",
            ),
            pytest.param(
                "[project]\ndependencies=['A']\noptional-dependencies.alpha=[]",
                "alpha,beta",
                ["A"],
                id="deps_with_one_empty_extra",
            ),
            pytest.param(
                "[project]\ndependencies=['A']\ndynamic=['optional-dependencies']",
                "",
                ["A"],
                id="deps_with_dynamic_optional_no_extra",
            ),
            pytest.param(
                dedent(
                    """
                    [project]
                    name='foo'
                    dependencies=['foo[alpha]']
                    optional-dependencies.alpha=['A']""",
                ),
                "",
                ["A"],
                id="deps_reference_extra",
            ),
            pytest.param(
                dedent(
                    """
                    [project]
                    name='foo'
                    dependencies=['A']
                    optional-dependencies.alpha=['B']
                    optional-dependencies.beta=['foo[alpha]']""",
                ),
                "beta",
                ["A", "B"],
                id="deps_with_recursive_extra",
            ),
            pytest.param(
                dedent(
                    """
                    [project]
                    name='foo'
                    dependencies=['A']
                    optional-dependencies.alpha=['B']
                    optional-dependencies.beta=['foo[alpha]']
                    optional-dependencies.delta=['foo[beta]', 'D']""",
                ),
                "delta",
                ["A", "B", "D"],
                id="deps_with_two_recursive_extra",
            ),
            pytest.param(
                dedent(
                    """
                    [project]
                    name='foo'
                    optional-dependencies.alpha=['foo[beta]', 'A']
                    optional-dependencies.beta=['foo[alpha]', 'B']""",
                ),
                "alpha",
                ["A", "B"],
                id="deps_with_circular_recursive_extra",
            ),
        ],
    )
    def test_pyproject_deps_from_static(
        tox_project: ToxProjectCreator,
        demo_pkg_inline: Path,
        conf: str,
        extra: str,
        deps: list[str],
    ) -> None:
        toml = f"{(demo_pkg_inline / 'pyproject.toml').read_text()}{conf}"
>       proj = tox_project({"tox.ini": f"[testenv]\nextras={extra}", "pyproject.toml": toml}, base=demo_pkg_inline)
conf       = "\n[project]\nname='foo'\noptional-dependencies.alpha=['foo[beta]', 'A']\noptional-dependencies.beta=['foo[alpha]', 'B']"
demo_pkg_inline = PosixPath('/builddir/build/BUILD/tox-4.4.11/tests/demo_pkg_inline')
deps       = ['A', 'B']
extra      = 'alpha'
toml       = '[build-system]\nrequires = []\nbuild-backend = "build"\nbackend-path = ["."]\n\n[tool.black]\nline-length = 120\n\n[p...\nname=\'foo\'\noptional-dependencies.alpha=[\'foo[beta]\', \'A\']\noptional-dependencies.beta=[\'foo[alpha]\', \'B\']'
tox_project = <function init_fixture.<locals>._init at 0x7fff9c41e840>
tests/tox_env/python/virtual_env/package/test_package_pyproject.py:157: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/pytest.py:421: in _init
    return ToxProject(files, base, prj_path or tmp_path / "p", capfd, monkeypatch, mocker)
        base       = PosixPath('/builddir/build/BUILD/tox-4.4.11/tests/demo_pkg_inline')
        capfd      = <_pytest.capture.CaptureFixture object at 0x7fff9c3e88d0>
        files      = {'pyproject.toml': '[build-system]\nrequires = []\nbuild-backend = "build"\nbackend-path = ["."]\n\n[tool.black]\nline...lpha=[\'foo[beta]\', \'A\']\noptional-dependencies.beta=[\'foo[alpha]\', \'B\']', 'tox.ini': '[testenv]\nextras=alpha'}
        mocker     = <pytest_mock.plugin.MockerFixture object at 0x7fff9c24ef10>
        monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fff9c3b0790>
        prj_path   = None
        tmp_path   = PosixPath('/tmp/pytest-of-mockbuild/pytest-1/popen-gw0/test_pyproject_deps_from_stati0')
../../BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/pytest.py:146: in __init__
    self._setup_files(self.path, base, files)
        base       = PosixPath('/builddir/build/BUILD/tox-4.4.11/tests/demo_pkg_inline')
        capfd      = <_pytest.capture.CaptureFixture object at 0x7fff9c3e88d0>
        files      = {'pyproject.toml': '[build-system]\nrequires = []\nbuild-backend = "build"\nbackend-path = ["."]\n\n[tool.black]\nline...lpha=[\'foo[beta]\', \'A\']\noptional-dependencies.beta=[\'foo[alpha]\', \'B\']', 'tox.ini': '[testenv]\nextras=alpha'}
        mocker     = <pytest_mock.plugin.MockerFixture object at 0x7fff9c24ef10>
        monkeypatch = <_pytest.monkeypatch.MonkeyPatch object at 0x7fff9c3b0790>
        path       = PosixPath('/tmp/pytest-of-mockbuild/pytest-1/popen-gw0/test_pyproject_deps_from_stati0/p')
        self       = ToxProject(path=/tmp/pytest-of-mockbuild/pytest-1/popen-gw0/test_pyproject_deps_from_stati0/p) at 140735814824144
../../BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/pytest.py:151: in _setup_files
    shutil.copytree(str(base), str(dest))
        base       = PosixPath('/builddir/build/BUILD/tox-4.4.11/tests/demo_pkg_inline')
        content    = {'pyproject.toml': '[build-system]\nrequires = []\nbuild-backend = "build"\nbackend-path = ["."]\n\n[tool.black]\nline...lpha=[\'foo[beta]\', \'A\']\noptional-dependencies.beta=[\'foo[alpha]\', \'B\']', 'tox.ini': '[testenv]\nextras=alpha'}
        dest       = PosixPath('/tmp/pytest-of-mockbuild/pytest-1/popen-gw0/test_pyproject_deps_from_stati0/p')
/usr/lib64/python3.11/shutil.py:561: in copytree
    return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
        copy_function = <function copy2 at 0x7fff9ed8fb00>
        dirs_exist_ok = False
        dst        = '/tmp/pytest-of-mockbuild/pytest-1/popen-gw0/test_pyproject_deps_from_stati0/p'
        entries    = [<DirEntry 'build.py'>, <DirEntry 'build.pyi'>, <DirEntry 'pyproject.toml'>, <DirEntry '.tox'>, <DirEntry '__pycache__'>]
        ignore     = None
        ignore_dangling_symlinks = False
        itr        = <posix.ScandirIterator object at 0x7fff9c3e46c0>
        src        = '/builddir/build/BUILD/tox-4.4.11/tests/demo_pkg_inline'
        symlinks   = False
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
entries = [<DirEntry 'build.py'>, <DirEntry 'build.pyi'>, <DirEntry 'pyproject.toml'>, <DirEntry '.tox'>, <DirEntry '__pycache__'>]
src = '/builddir/build/BUILD/tox-4.4.11/tests/demo_pkg_inline'
dst = '/tmp/pytest-of-mockbuild/pytest-1/popen-gw0/test_pyproject_deps_from_stati0/p'
symlinks = False, ignore = None
copy_function = <function copy2 at 0x7fff9ed8fb00>
ignore_dangling_symlinks = False, dirs_exist_ok = False
    def _copytree(entries, src, dst, symlinks, ignore, copy_function,
                  ignore_dangling_symlinks, dirs_exist_ok=False):
        if ignore is not None:
            ignored_names = ignore(os.fspath(src), [x.name for x in entries])
        else:
            ignored_names = set()
    
        os.makedirs(dst, exist_ok=dirs_exist_ok)
        errors = []
        use_srcentry = copy_function is copy2 or copy_function is copy
    
        for srcentry in entries:
            if srcentry.name in ignored_names:
                continue
            srcname = os.path.join(src, srcentry.name)
            dstname = os.path.join(dst, srcentry.name)
            srcobj = srcentry if use_srcentry else srcname
            try:
                is_symlink = srcentry.is_symlink()
                if is_symlink and os.name == 'nt':
                    # Special check for directory junctions, which appear as
                    # symlinks but we want to recurse.
                    lstat = srcentry.stat(follow_symlinks=False)
                    if lstat.st_reparse_tag == stat.IO_REPARSE_TAG_MOUNT_POINT:
                        is_symlink = False
                if is_symlink:
                    linkto = os.readlink(srcname)
                    if symlinks:
                        # We can't just leave it to `copy_function` because legacy
                        # code with a custom `copy_function` may rely on copytree
                        # doing the right thing.
                        os.symlink(linkto, dstname)
                        copystat(srcobj, dstname, follow_symlinks=not symlinks)
                    else:
                        # ignore dangling symlink if the flag is on
                        if not os.path.exists(linkto) and ignore_dangling_symlinks:
                            continue
                        # otherwise let the copy occur. copy2 will raise an error
                        if srcentry.is_dir():
                            copytree(srcobj, dstname, symlinks, ignore,
                                     copy_function, ignore_dangling_symlinks,
                                     dirs_exist_ok)
                        else:
                            copy_function(srcobj, dstname)
                elif srcentry.is_dir():
                    copytree(srcobj, dstname, symlinks, ignore, copy_function,
                             ignore_dangling_symlinks, dirs_exist_ok)
                else:
                    # Will raise a SpecialFileError for unsupported file types
                    copy_function(srcobj, dstname)
            # catch the Error from the recursive copytree so that we can
            # continue with other files
            except Error as err:
                errors.extend(err.args[0])
            except OSError as why:
                errors.append((srcname, dstname, str(why)))
        try:
            copystat(src, dst)
        except OSError as why:
            # Copying file access times may fail on Windows
            if getattr(why, 'winerror', None) is None:
                errors.append((src, dst, str(why)))
        if errors:
>           raise Error(errors)
E           shutil.Error: [('/builddir/build/BUILD/tox-4.4.11/tests/demo_pkg_inline/.tox/py/lib/python3.11/site-packages/~emo_pkg_inline-1.0.0.dist-info', '/tmp/pytest-of-mockbuild/pytest-1/popen-gw0/test_pyproject_deps_from_stati0/p/.tox/py/lib/python3.11/site-packages/~emo_pkg_inline-1.0.0.dist-info', "[Errno 2] No such file or directory: '/builddir/build/BUILD/tox-4.4.11/tests/demo_pkg_inline/.tox/py/lib/python3.11/site-packages/~emo_pkg_inline-1.0.0.dist-info'"), ('/builddir/build/BUILD/tox-4.4.11/tests/demo_pkg_inline/.tox/py/lib/python3.11/site-packages/~emo_pkg_inline', '/tmp/pytest-of-mockbuild/pytest-1/popen-gw0/test_pyproject_deps_from_stati0/p/.tox/py/lib/python3.11/site-packages/~emo_pkg_inline', "[Errno 2] No such file or directory: '/builddir/build/BUILD/tox-4.4.11/tests/demo_pkg_inline/.tox/py/lib/python3.11/site-packages/~emo_pkg_inline'")]
copy_function = <function copy2 at 0x7fff9ed8fb00>
dirs_exist_ok = False
dst        = '/tmp/pytest-of-mockbuild/pytest-1/popen-gw0/test_pyproject_deps_from_stati0/p'
dstname    = '/tmp/pytest-of-mockbuild/pytest-1/popen-gw0/test_pyproject_deps_from_stati0/p/__pycache__'
entries    = [<DirEntry 'build.py'>, <DirEntry 'build.pyi'>, <DirEntry 'pyproject.toml'>, <DirEntry '.tox'>, <DirEntry '__pycache__'>]
errors     = [('/builddir/build/BUILD/tox-4.4.11/tests/demo_pkg_inline/.tox/py/lib/python3.11/site-packages/~emo_pkg_inline-1.0.0.d...ctory: '/builddir/build/BUILD/tox-4.4.11/tests/demo_pkg_inline/.tox/py/lib/python3.11/site-packages/~emo_pkg_inline'")]
ignore     = None
ignore_dangling_symlinks = False
ignored_names = set()
is_symlink = False
src        = '/builddir/build/BUILD/tox-4.4.11/tests/demo_pkg_inline'
srcentry   = <DirEntry '__pycache__'>
srcname    = '/builddir/build/BUILD/tox-4.4.11/tests/demo_pkg_inline/__pycache__'
srcobj     = <DirEntry '__pycache__'>
symlinks   = False
use_srcentry = True
/usr/lib64/python3.11/shutil.py:515: Error
=============================== warnings summary ===============================
tests/session/cmd/test_parallel.py::test_parallel_show_output_with_pkg
  /usr/lib/python3.11/site-packages/_pytest/threadexception.py:73: PytestUnhandledThreadExceptionWarning: Exception in thread tox-interrupt
  
  Traceback (most recent call last):
    File "/usr/lib64/python3.11/threading.py", line 1038, in _bootstrap_inner
      self.run()
    File "/usr/lib64/python3.11/threading.py", line 975, in run
      self._target(*self._args, **self._kwargs)
    File "/builddir/build/BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/session/cmd/run/common.py", line 331, in _queue_and_wait
      result = future.result()
               ^^^^^^^^^^^^^^^
    File "/usr/lib64/python3.11/concurrent/futures/_base.py", line 449, in result
      return self.__get_result()
             ^^^^^^^^^^^^^^^^^^^
    File "/usr/lib64/python3.11/concurrent/futures/_base.py", line 401, in __get_result
      raise self._exception
    File "/usr/lib64/python3.11/concurrent/futures/thread.py", line 58, in run
      result = self.fn(*self.args, **self.kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/builddir/build/BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/session/cmd/run/common.py", line 304, in _run
      return run_one(
             ^^^^^^^^
    File "/builddir/build/BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/session/cmd/run/single.py", line 34, in run_one
      skipped, code, outcomes = _evaluate(tox_env, no_test)
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/builddir/build/BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/session/cmd/run/single.py", line 61, in _evaluate
      tox_env.teardown()
    File "/builddir/build/BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/tox_env/api.py", line 265, in teardown
      self._teardown()
    File "/builddir/build/BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/tox_env/runner.py", line 83, in _teardown
      self._call_pkg_envs("teardown_env", self.conf)
    File "/builddir/build/BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/tox_env/runner.py", line 116, in _call_pkg_envs
      getattr(package_env, method_name)(*args)
    File "/builddir/build/BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/tox_env/package.py", line 47, in _func
      return meth(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
    File "/builddir/build/BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/tox_env/package.py", line 103, in teardown_env
      self._teardown()
    File "/builddir/build/BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/tox_env/package.py", line 47, in _func
      return meth(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
    File "/builddir/build/BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/tox_env/python/virtual_env/package/pyproject.py", line 172, in _teardown
      self._frontend._send("_exit")  # try first on amicable shutdown
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/builddir/build/BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/tox_env/python/virtual_env/package/pyproject.py", line 347, in _send
      return super()._send(cmd, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib/python3.11/site-packages/pyproject_api/_frontend.py", line 489, in _send
      with self._send_msg(cmd, result_file, msg) as status:
    File "/usr/lib64/python3.11/contextlib.py", line 144, in __exit__
      next(self.gen)
    File "/builddir/build/BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/tox_env/python/virtual_env/package/pyproject.py", line 358, in _send_msg
      with self._tox_env.execute_async(
    File "/usr/lib64/python3.11/contextlib.py", line 144, in __exit__
      next(self.gen)
    File "/builddir/build/BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/tox_env/api.py", line 444, in execute_async
      self._log_execute(request, execute_status)
    File "/builddir/build/BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/tox_env/package.py", line 47, in _func
      return meth(*args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^
    File "/builddir/build/BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/tox_env/api.py", line 450, in _log_execute
      self._write_execute_log(self.name, self.env_log_dir / f"{self._log_id}-{request.run_id}.log", request, status)
    File "/builddir/build/BUILDROOT/python-tox-4.4.11-1.fc39.noarch/usr/lib/python3.11/site-packages/tox/tox_env/api.py", line 454, in _write_execute_log
      with log_file.open("wt", encoding="utf-8") as file:
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/usr/lib64/python3.11/pathlib.py", line 1044, in open
      return io.open(self, mode, buffering, encoding, errors, newline)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  FileNotFoundError: [Errno 2] No such file or directory: '/builddir/build/BUILD/tox-4.4.11/tests/demo_pkg_inline/.tox/.pkg/log/5-_exit.log'
  
    warnings.warn(pytest.PytestUnhandledThreadExceptionWarning(msg))
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED tests/session/cmd/test_parallel.py::test_parallel_show_output_with_pkg
FAILED tests/tox_env/python/virtual_env/package/test_package_pyproject.py::test_pyproject_deps_from_static[deps_with_circular_recursive_extra]

@hroncok
Copy link
Contributor Author

hroncok commented Apr 13, 2023

hroncok added a commit to hroncok/tox that referenced this issue Apr 13, 2023
By using FileLock (already used as a dependency),
we ensure only one test uses the demo_pkg at a time.

This avoid race conditions happening with `pytest -n=auto`.

Fixes tox-dev#2985
hroncok added a commit to hroncok/tox that referenced this issue Apr 13, 2023
By using FileLock (already used as a dependency),
we ensure only one test uses the demo_pkg at a time.

This avoids race conditions happening with `pytest -n=auto`.

Fixes tox-dev#2985
@hroncok
Copy link
Contributor Author

hroncok commented Apr 13, 2023

#2986

hroncok added a commit to hroncok/tox that referenced this issue Apr 13, 2023
By using FileLock (already used as a dependency),
we ensure only one test uses the demo_pkg at a time.

This avoids race conditions happening with `pytest -n=auto`.

Fixes tox-dev#2985
hroncok added a commit to hroncok/tox that referenced this issue Apr 13, 2023
By using FileLock (already used as a dependency),
we ensure only one test uses the demo_pkg at a time.

This avoids race conditions happening with `pytest -n=auto`.

Fixes tox-dev#2985
hroncok added a commit to hroncok/tox that referenced this issue Apr 13, 2023
By using FileLock (already used as a dependency),
we ensure only one test uses the demo_pkg at a time.

This avoids race conditions happening with `pytest -n=auto`.

Fixes tox-dev#2985
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant