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 suite gets stuck when running on Windows PyPy 7.3.15 #1737
Comments
I am able to reproduce the issue, it gets stuck within 2-3 minutes on my machine. Console output:
I'm not sure if this is relevant, but the CPU usage stays high even after ctrl+C until the terminal window is closed. Looking at the task manager, Microsoft Defender seems to be the culprit: |
Is there a way to tell if Defender is running in GitHub Actions? Do we know if the same thing will happen on your machine with 7.3.14, because that version of PyPy succeeded on GitHub Actions. |
I believe the Defender thing is a red herring, because it also gets stuck with Defender disabled. Currently looking into |
@devdanzin Thanks for looking into this. I tried skipping the MultiprocessingTest's, and it still hung at the end: https://github.com/nedbat/coveragepy/actions/runs/7619979724/job/20753958961#step:5:660 |
Just tested with pypy 7.3.14 on my machine, it runs fine (no issues with Defender either):
|
I've confirmed that I'm still betting on multiprocessing, but simply running the core code of the test doesn't trigger a hang. It seems to need both the |
I can confirm that if we completely remove test_concurrency.py from the test suite, then it all completes with no problems: https://github.com/nedbat/coveragepy/actions/runs/7626679133 |
My testing on Windows also sees the test suite stop here:
|
Here's a simple way to reproduce, which gives hints about what's going wrong. Create a .coveragerc file in a directory:
Create a code.py file in the same directory: def work(x):
return x
import multiprocessing
import os
import sys
def process_worker_main(args):
ret = work(*args)
return os.getpid(), ret
if __name__ == "__main__": # pragma: no branch
print(sys.executable) # Prints the virtual environment PyPy in 7.3.14, but the system PyPy in 7.3.15.
multiprocessing.set_start_method("spawn")
pool = multiprocessing.Pool(3)
inputs = [(x,) for x in range(6)]
outputs = pool.imap_unordered(process_worker_main, inputs)
pool.close()
pool.join() Run coverage from that directory with multiprocessing as concurrency:
Edit: Actually this error is the one that shows when killing coverage.exe
The original never ending error stream contains:
Runs to completion on 7.3.14. |
Hah, installing coverage into the bare/system PyPy solves the issue. So it seems to be an artifact of running in a virtual environment that has coverage installed, but somehow picking up the system PyPy environment in multiprocessing. If I had to guess, I'd guess it has to do with this PyPy change from this commit. Edit: Confirmed, adding |
This is the likely cause of our test suite hanging in CI. Possibly related issues: - nedbat/coveragepy#1737 - nedbat/coveragepy#1738
This is the likely cause of our test suite hanging in CI. Possibly related issues: - nedbat/coveragepy#1737 - nedbat/coveragepy#1738
PyPy 7.3.16 has been released with a fix for this issue. |
The coverage.py test suite gets stuck on Windows PyPy for PyPy version 7.3.15.
Here's an example action run that gets canceled after 6 hours. The 6 hours is GitHub Actions' timeout for jobs. The test suite itself seems to reach the stuck point after about 10 minutes.
The Windows PyPy 3.8 runs don't get stuck because they use PyPy 7.3.11.
The last successful PyPy 3.10 run on Windows was using PyPy 7.3.14.
The same suite doesn't hang on Mac or Ubuntu using PyPy 7.3.15.
I'm hoping it can be reproduced (and debugged) by following the contributing directions and running
tox -e pypy3
.The text was updated successfully, but these errors were encountered: