Repository navigation
make the thread-leak test wait on the thing it asserts - #63
Merged
Merged
Conversation
Linux CI went red on main with `assert 3 == 2` at test_nonresponding_server_timeout_leaves_no_client_work, having passed on macOS and on the same commit's pull-request run. A re-run was green, so it is a race. The test waited on one observable and asserted another. Its loop polled the server's active-handler count to zero, but the handler decrements that counter from inside itself and then still has to unwind, so there is a window where the counter reads zero while the thread object is alive. thread_count was therefore read before the quantity it measures had settled. The wait now polls the thread count alongside the handler count, inside the same bound. Nothing is skipped or softened: if the count does not return to baseline within the existing 50 x 0.01s window the assertion still fails. CONTRIBUTING.md carried a record of an unidentified intermittent failure at 817b96d. This entry does not close it. The earlier failure's name was never captured, so whether the two are the same incident is unknown, and this file does not round "not reproduced" into "does not exist" -- both are now recorded, separately and as what they are.
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.
Linux CI went red on
mainwithassert 3 == 2attest_nonresponding_server_timeout_leaves_no_client_work, having passed on macOS and on the same commit's PR run. A re-run of that job came back green, so it is a race rather than a regression.The test waited on one observable and asserted another
The loop polled
server.active_handlersto zero — but the handler decrements that counter from inside itself and then still has to unwind and exit. So there is a window where the counter reads zero while the thread object is still alive, andthreading.active_count()was read inside it.That is this repository's recurring defect shape in a new place: the quantity waited on is not the quantity asserted.
Nothing is skipped or softened. If the thread count does not return to baseline within the existing 50 × 0.01s bound, the assertion still fails.
The old record is kept, not closed
CONTRIBUTING.md carried a note about an unidentified intermittent failure at
817b96d(1 failed, 1259 passed, six clean retries, name never captured). It is tempting to close that against this entry, and the file now explicitly declines to: the name was never recorded, so whether the two are the same incident is unknown. Both are recorded, separately, as what they are.Gates
pytest1286 passed, 3 skipped, unchanged — this repairs an existing test rather than adding behaviour.ruff check .andruff format --check .exit 0. One assertion-line change plus the documentation entry; no assertion deleted, skipped or loosened.The race is Linux-specific, so local stress is weak evidence: 25/25 green on macOS, where it already passed. CI on this PR is the real check.