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

Emergent Access Denied errors on Windows #28

Open
jaraco opened this issue Jul 10, 2024 · 3 comments
Open

Emergent Access Denied errors on Windows #28

jaraco opened this issue Jul 10, 2024 · 3 comments

Comments

@jaraco
Copy link
Contributor

jaraco commented Jul 10, 2024

With the release of pytest-ruff 0.4, when running a sizeable test suite under pytest-xdist on Windows, many failures are emitted. This issue was reported in pypa/setuptools#4467.

It seems that there's a race condition when ruff is invoked in parallel on the same project on Windows. The cache files collide and fail to be saved.

This issue was masked in 0.3.2 because the exit code from ruff was 2 and ignored.

I wonder if pytest-ruff should detect these "errors saving cache" and continue to suppress them. Or maybe ruff should have a separate exit code for "access denied when saving cache" so that "pytest-ruff" can suppress that code.

Thoughts?

jaraco added a commit to pypa/setuptools that referenced this issue Jul 10, 2024
@jaraco
Copy link
Contributor Author

jaraco commented Jul 10, 2024

In a conversation with the Ruff team, they've indicated a desire to handle this situation more robustly, so there may be nothing for pytest-ruff to do here.

@jaraco
Copy link
Contributor Author

jaraco commented Jul 13, 2024

Now that ruff has merged a fix, we know the long-term strategy, but there's still an issue for consumers. In particular, setuptools is still pinned against pytest-ruff 0.4. Once the latest ruff is released, setuptools can remove that pin, but will still fail in environments that happen to pick up the latest pytest-ruff but an older version of ruff.

I see that pytest-ruff depends on a very old ruff, so I'm uneasy suggesting that should be bumped to ruff>0.5.1 (once available).

Maybe it's not common enough for an environment to encounter that condition above, so it's not worth addressing.

If we wanted to address this issue in pytest-ruff, we could do so thus:

  • inspect exit code 2
  • if the error message is "Access Denied", ignore it

That would give users of pytest-ruff 0.4.1 (or similar new release) the stable behavior without having to avoid older versions of ruff.

Personally, I'm just happy to "work at head" (expect the latest versions of everything), but others may want to be more precise about the requirements or have pinned behavior on older versions of ruff.

I'll leave it to the maintainer to decide how to proceed.

@iurisilvio
Copy link
Contributor

I think it is a good idea to check ruff output to ignore these known errors. 👍🏻

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

No branches or pull requests

2 participants