You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 3a1bf2e
Browse filesBrowse the repository at this point in the historyBrowse files
fix: Eliminate race condition in testNonBlockingWithMultipleMessages
Addresses intermittent test failure where subscribeToTask created child queues
but EventConsumer polling loops hadn't started yet when the agent executed,
causing emitted events to be lost.
Root Cause:
- awaitStreamingSubscription() only guarantees transport-level subscription
(Flow.Subscriber.onSubscribe() called)
- EventConsumer polling starts asynchronously on eventConsumerExecutor thread
- Agent execution could begin before EventConsumer was actively polling
- Events emitted before polling started were lost in the queue
Solution:
- Added awaitChildQueueCountStable() to TestUtilsBean
- Waits for child queue count to match expected value for 3 consecutive
checks (150ms total), ensuring EventConsumer is actively polling
- Follows pattern from commit 18d2abf which fixed similar race condition
- Exposed REST endpoints in all transports (JSON-RPC, gRPC, REST)
- Added client helper in AbstractA2AServerTest
- Applied stability check after subscribeToTask() in tests
- Increased timeouts from 10s to 15s for CI stability
Files Modified:
- TestUtilsBean.java: Core synchronization logic with comprehensive Javadoc
- A2ATestRoutes.java (JSON-RPC, REST): REST endpoints for stability checks
- A2ATestResource.java (gRPC): REST endpoints for stability checks
- AbstractA2AServerTest.java: Client helper and extensive inline comments
0 commit comments