Repository navigation
tests: keep GC pauses out of the node-deadline timing window - #54
Merged
Merged
Conversation
On Python 3.14 a full-suite collection pause can run 0.5-1 s, more than the 0.45 s slack between the 0.25 s deadline and the 0.7 s bound. One landed in test_complete_deadline_interrupts_real_http_reads[503-body] on every 3.14 run of #51 and #52 (0.83-0.99 s), whose extra tests shift where collections fall. slow_node now disables automatic GC while its server is up and restores the previous state afterwards. Deadline code and bounds are unchanged.
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Owner
Author
|
Local full suite on this branch (Python 3.14.3, with the |
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.
Problem
tests/test_node_deadlines.py::test_complete_deadline_interrupts_real_http_reads[503-body]failed on every Python 3.14 CI run of #51 (attempts 1 and 2) and #52 (attempts 1 and 2). It took 0.83–0.99 s against its 0.7 s bound.main, #47 and #53 passed. All runs used CPython 3.14.7, and the test passes alone locally.The cause is a garbage-collection pause, not the deadline code. A local full suite on 3.14 with a
gc.callbacksprobe logged 31 collections over 30 ms: up to 1.04 s for gen 2 and 0.5–0.7 s for several gen 1 passes. Those pauses are larger than the 0.45 s of slack betweenTOTAL(0.25 s) andUPPER_BOUND(0.7 s). Collections fall at deterministic points in the suite, and the tests #51 and #52 add moved one into[503-body].Change
slow_nodedisables automatic GC while its server is up and restores the previous state on exit. That covers every timed assertion in this file, including theerror_headerscase, which has only 0.25 s of slack. Deadline code,TOTAL,UPPER_BOUNDand the server stall times are unchanged, so the tests still prove the same bounds.Checks
pytest -q tests/test_node_deadlines.py: 13 passed.git diff --check: clean.After this merges, #51 and #52 need
mainmerged in to rerun CI.