-
-
Notifications
You must be signed in to change notification settings - Fork 505
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
Comments
More examples from the Fedora build log:
|
Something like this works: https://pytest-xdist.readthedocs.io/en/stable/how-to.html#making-session-scoped-fixtures-execute-only-once Will send a PR. |
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
5 tasks
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
Issue
I've observed the following test failures of tox (4.4.11 or main @ ea169d0):
This only happens sometimes and depends on how xdist schedules the tests. Sometimes 2 tests fails, sometimes 1, sometimes they pass.
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]
fromtests/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:
pip list
of the host Python wheretox
is installed:The text was updated successfully, but these errors were encountered: