Skip to content

fix(test): stabilize KafkaReplicationIntegrationTest by waiting for first SSE event#864

Merged
kabir merged 1 commit into
a2aproject:mainfrom
ehsavoie:flaky_test
May 12, 2026
Merged

fix(test): stabilize KafkaReplicationIntegrationTest by waiting for first SSE event#864
kabir merged 1 commit into
a2aproject:mainfrom
ehsavoie:flaky_test

Conversation

@ehsavoie
Copy link
Copy Markdown
Collaborator

Replace awaitQueuePollerStart (unreliable after re-subscription) with a CountDownLatch that fires when the client receives its first event, ensuring the HTTP/SSE connection is fully established before sending the QueueClosedEvent.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request refactors KafkaReplicationIntegrationTest.java to improve the reliability of the testQueueClosedEventTerminatesRemoteSubscribers test. It replaces the QueueManager polling check with a CountDownLatch that waits for the first event from the subscription, ensuring the connection is established before simulating a queue closure. Review feedback suggests verifying that the first event is a TaskEvent to comply with the A2A specification and updating the error handler to gracefully handle benign stream closure exceptions to prevent test flakiness.

…irst SSE event

Replace `awaitQueuePollerStart` (unreliable after re-subscription) with a
`CountDownLatch` that fires when the client receives its first event, ensuring
the HTTP/SSE connection is fully established before sending the QueueClosedEvent.

Signed-off-by: Emmanuel Hugonnet <ehugonne@redhat.com>
@kabir kabir merged commit 841c302 into a2aproject:main May 12, 2026
7 of 8 checks passed
@ehsavoie ehsavoie deleted the flaky_test branch May 13, 2026 09:02
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