-
-
Notifications
You must be signed in to change notification settings - Fork 457
Closed
Labels
Description
Describe the bug
The coverage of the code run through python's multiprocessing can be taken into account or not, randomly.
There seems to be some race condition happening when SIGTERM is received, sometimes coverage has time to properly report run code, sometimes it doesn't.
To Reproduce
- What version of Python are you using? Python 3.12.4
- What version of coverage.py shows the problem? coverage_version: 7.6.9
- What versions of what packages do you have installed? pytest@8.3.4
- What code shows the problem? https://github.com/sprezz-arthur/flaky-coverage-mre
- What commands should we run to reproduce the problem?
rm -rf htmlcov && rm -f .coverage && coverage run -m pytest && coverage combine && coverage html
Expected behavior
I expected the code run through multiprocessing to always be taken into account
Additional context
I'm using pyproject.toml for config with the following content:
[tool.coverage.run]
branch = true
parallel = true
sigterm = true
concurrency = [
"multiprocessing",
]