OSError: [Errno 39] Directory not empty
when doing cache.mkdir()
from session fixture + pytest-xdist
#12381
Closed
4 tasks done
Labels
plugin: cache
related to the cache builtin plugin
plugin: xdist
related to the xdist external plugin
type: bug
problem that needs to be addressed
type: regression
indicates a problem that was introduced in a release which was working previously
pip list
from the virtual environment you are usingcache.mkdir()
in a session-level fixture, in combination with xdist, sometimes results inOSError: [Errno 39] Directory not empty
when pytest tries to rename the cache directory.This is a regression in 8.2.0, most likely introduced by #12168 / #12167
On 8.1.x
cache.mkdir()
works fine in the same case.In
conftest.py
:In
test_tests.py
:Running with
pytest -n auto
results in:Operating System: Ubuntu 22.04.4 LTS
Python 3.10.12, pytest-8.2.1
Virtualenv content:
exceptiongroup==1.2.1,execnet==2.1.1,iniconfig==2.0.0,packaging==24.0,pluggy==1.5.0,pytest==8.2.1,pytest-xdist==3.6.1,tomli==2.0.1
https://github.com/amezin/pytest-cache-race
Reproduced in GitHub Actions: https://github.com/amezin/pytest-cache-race/actions/runs/9261012859/job/25475719651
The text was updated successfully, but these errors were encountered: