Closed jaraco closed 4 months ago
If I run the tests with -p no:xdist
, the errors go away, suggesting there's some interaction between pytest-xdist and pytest-ruff.
Wait what? After bringing back xdist
, the tests are still passing. It seems that maybe the presence of xdist
may not be relevant and it may be due to some state being present or not (maybe .ruff_cache).
Okay, so it seems I need to both:
.ruff_cache
, andxdist
for the failures to occur. They occur with -k ruff
.
If I run pytest -k ruff
repeatedly, the failures become less and less until all of the tests have cached results and pass.
I know pytest-ruff 0.4
added support for the returncode == 2
, so probably these errors were happening before but were simply silently ignored.
My guess is that 13567325068112760734 is some sort of time stamp and due to xdist
, it's somehow getting used in parallel across multiple interpreters. My guess is that it only happens on Windows because Unix systems will allow the move even when the destination exists.
Confirmed that downgrading to pytest-ruff 0.3.2
bypasses the failure.
I'm trying to figure out the best workaround here. Options include:
I think I'm going to opt for option 1 for now, since it's the least intrusive and retains the value of running the checks on Windows and keeping the performance benefits of xdist.
Since the recent updates to ruff and pytest-ruff, the tests are now failing on Windows on Python 3.12 only: