-
Notifications
You must be signed in to change notification settings - Fork 586
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
Coverage file "branch-check" gets truncated multiple times during coverage testing #1718
Comments
|
The truncation happens here: hypothesis/hypothesis-python/src/hypothesis/internal/coverage.py Lines 62 to 65 in 8726b80
This occurs at the top-level of the module, and is presumably only supposed to happen once. But in reality it runs multiple times. |
|
I created a global flag that gets set when the truncation occurs. Future truncations see this flag as unset, which suggests that the module is being imported multiple times from different contexts that don't share an import cache. |
|
I also tried removing the automatic truncation entirely, and truncated This resulted in ~14 “always True” complaints, which suggests that this issue has been concealing holes in branch-check coverage. |
|
I modified Looks like the problem is triggered by subprocess tests that import |
|
I think the solution here is to remove the truncation from (Subprocess invocations still won't share a cache of previously-written lines, but that shouldn't affect correctness. The checker script can handle duplication.) |
As observed in #1712, the
branch-checkfile that is written bycoverage.pygets truncated multiple times during the coverage test run, instead of just once at the beginning.(This happens on
mastertoo, not just in the v4 PR branch.)Presumably this means that many of the entries are being lost, so the branch coverage checks aren't as thorough as they appear.
The text was updated successfully, but these errors were encountered: