Repository navigation
test: read the full event stream before asserting in the resubscription test - #1406
Merged
mykytanetipa merged 3 commits intoOct 31, 2026
Conversation
…on test test_task_resubscription broke out of the SSE read loop after the first chunk and then asserted that later artifact events were present. That only held when the first network read happened to contain every event, so the test failed on platforms where the first read returned a single event, for example on Windows. Read the stream to completion before asserting, matching the sibling test_message_send_stream. The behavior under test is unchanged.
🧪 Code Coverage (vs
|
mykytanetipa
requested changes
Oct 30, 2026
mykytanetipa
approved these changes
Oct 31, 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.
What this changes
test_task_resubscriptionnow reads the full SSE stream before asserting, instead of breaking out of the read loop after the first chunk.Why
The test broke out of the loop as soon as it had read one SSE event, then asserted that the second and third artifact events were also present. That only holds when the first network read happens to contain every event. On platforms where the first read returns a single event, for example on Windows,
artifact-1andartifact-2were not in the buffer yet and the assertions failed.Reproduced on Windows with Python 3.13:
test_task_resubscriptionfailed on every run before this change and passes on every run after it. The rest oftests/server/test_integration.pykeeps passing (30 passed).The fix
Drop the early break so the loop drains the stream, matching the sibling
test_message_send_stream, which already reads to completion before asserting. The server behavior under test is unchanged; only the test's read loop changes.