Skip to content

test: read the full event stream before asserting in the resubscription test - #1406

Merged
mykytanetipa merged 3 commits into
a2aproject:mainfrom
BHAWESHBHASKAR:test/resubscription-read-full-stream
Oct 31, 2026
Merged

mykytanetipa merged 3 commits into
a2aproject:mainfrom
BHAWESHBHASKAR:test/resubscription-read-full-stream

Conversation

@BHAWESHBHASKAR

Copy link
Copy Markdown
Contributor

What this changes

test_task_resubscription now 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-1 and artifact-2 were not in the buffer yet and the assertions failed.

Reproduced on Windows with Python 3.13: test_task_resubscription failed on every run before this change and passes on every run after it. The rest of tests/server/test_integration.py keeps 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.

…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.
@BHAWESHBHASKAR
BHAWESHBHASKAR requested a review from a team as a code owner October 30, 2026 10:27
@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

🧪 Code Coverage (vs main)

⬇️ Download Full Report

No coverage changes.

Generated by coverage-comment.yml

@mykytanetipa mykytanetipa self-assigned this Oct 30, 2026
Comment thread tests/server/test_integration.py Resolved
@mykytanetipa
mykytanetipa merged commit 6ca8593 into a2aproject:main Oct 31, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants