Repository navigation
Give the re-init stress test's readers time to drain - #1633
Merged
Merged
Conversation
test_reinit_finalizer_vs_lock_free_readers timed out on Windows 3.10 to 3.12 while waiting for its readers. A faulthandler dump showed them still running the finalizers of generations their snapshots outlived, each blocked in coverage's lock_data(): the C tracer takes a lock the threads share on every traced line. The work is bounded, it is just slow, up to three minutes on those runners. Wait up to five minutes for the writer and five, shared, for the readers, inside the job's fifteen.
asvetlov
marked this pull request as ready for review
September 28, 2026 18:28
Contributor
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1633 +/- ##
===========================================
- Coverage 100.00% 98.49% -1.51%
===========================================
Files 44 47 +3
Lines 8412 9023 +611
Branches 710 775 +65
===========================================
+ Hits 8412 8887 +475
- Misses 0 132 +132
- Partials 0 4 +4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What do these changes do?
test_reinit_finalizer_vs_lock_free_readers(#1621) timed out on the Windows 3.10, 3.11 and 3.12 jobs, atf.result(timeout=60)for its readers. The faulthandler dump from a 183 s run shows every reader still insideValue.__del__()->probe()after the writer finished, each blocked incoverage/collector.py: lock_data. Under coverage's C tracer (3.10 to 3.12) every traced line takes a lock the threads share, and the readers are draining the finalizers of generations theircopy()snapshots outlived. That work is bounded (3216 finalizers, nesting depth 1), just slow: 0.4 s without coverage, 12 to 20 s with it on a Linux 3.11 box, and over three minutes on the Windows runners. The failure reports also show every reader future finished by the time pytest rendered them.The writer now gets 300 s and the readers a shared 300 s deadline, inside the job's 15-minute limit.
Are there changes in behavior for the user?
No, tests only.
Is it a substantial burden for the maintainers to support this?
No.
Related issue number
Follows #1621. Failed on #1625, #1628 (twice) and #1630; re-runs passed.
Checklist
CONTRIBUTORS.txt(N/A)CHANGES/foldermake doc-spellingpasses and any new technical words are added todocs/spelling_wordlist.txtAgent run details (optional, for reviewers)
tests/test_free_threading.py: GIL 3.14.7 10 passed, FT 3.14.7t 10 passed (without coverage); 3.11.13 with coverage, the two cases took 12.4 s and 19.9 s.Lint: pre-commit clean.
Drafted with Claude Code (Claude Opus 5.5); reviewed by @asvetlov.