Repository navigation
test: fail the keep-alive stop test when the connection stays open - #5939
Merged
Merged
Conversation
test_server_stop_closes_accepted_keep_alive_connections caught `OSError` around its final read, and `TimeoutError` is an `OSError`. A connection a stopped server left open, such as one a surviving child process inherited, times out rather than closing, so the test read that as a close and passed. It now accepts only end of stream, a reset or a broken pipe as the close. Behavior protected: `leaf server stop` closes the keep-alive connections the server accepted; a timeout now fails the test instead of passing it.
This was referenced Nov 14, 2026
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.
test_server_stop_closes_accepted_keep_alive_connectionscan pass when the connection it checks stays open. Its final read caughtOSError, which includesTimeoutError. A socket the stopped server left open, such as one a surviving child process inherited, doesn't close: the read times out afterSTATED_TIMEOUT. The test took that timeout for a close and passed, although it is exactly the failure the test exists to catch.tests/AGENTS.mdrules that a time limit must never turn unfinished work into a pass.The read now accepts only end of stream,
ConnectionResetErrororBrokenPipeErroras the close, and a timeout fails the test. No product code changes.Verification. The test passed in five runs here, so a real close still shows up as one of those three outcomes. On this runner's Python, a timed-out
recvraisesTimeoutError, andisinstance(error, OSError)is true.Found by the nightly survey of
tests/model/test_server_lifetime.py.