You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a test environment utilizing pytest-ruff and pytest-xdist, many tests will be run in parallel and since pytest-ruff passes each file to a separate ruff invocation, there may potentially be many instances of ruff launched for the same root directory and settings (and thus cache key).
As a result, Ruff will fail and exit with code 2 with the following output:
Cause: Failed to rename temporary cache file to D:\a\setuptools\setuptools\.ruff_cache\0.5.1\13567325068112760734
Cause: failed to persist temporary file: Access is denied. (os error 5)
Cause: Access is denied. (os error 5)
Since it's a cache file, maybe the failure should be ignored, or maybe it could be retried.
At the very least, catching this error and exiting with a distinct exit code would allow tools like pytest-ruff to ignore the failure.
The text was updated successfully, but these errors were encountered:
My guess is the same behavior is happening on Linux too, but the file system allows the race to be resolved by replacing the file. Maybe there's a Windows file operation that's comparable.
In pypa/setuptools#4467 and businho/pytest-ruff#28 and this Discord convo, I've captured an issue that's recently become apparent when pytest-ruff started failing on an exit code 2 (pytest-ruff 0.4).
In a test environment utilizing
pytest-ruff
andpytest-xdist
, many tests will be run in parallel and sincepytest-ruff
passes each file to a separateruff
invocation, there may potentially be many instances of ruff launched for the same root directory and settings (and thus cache key).As a result, Ruff will fail and exit with code 2 with the following output:
Since it's a cache file, maybe the failure should be ignored, or maybe it could be retried.
At the very least, catching this error and exiting with a distinct exit code would allow tools like
pytest-ruff
to ignore the failure.The text was updated successfully, but these errors were encountered: