Commit a3f2721
fix: Use thread pool executor in ResultAggregatorTest instead of direct executor
Problem:
- Tests used directExecutor (Runnable::run) which executes tasks synchronously
- When ResultAggregator calls CompletableFuture.runAsync(task, directExecutor),
the task runs on the calling thread instead of a background thread
- In SSE streaming tests on REST transport, this blocks the Vert.x worker thread
- Client times out waiting for response headers (httpx.ReadTimeout)
Root Cause:
- directExecutor executes runAsync() tasks synchronously on calling thread
- This defeats the purpose of using runAsync() for non-blocking operation
- Real production code uses @internal Executor (thread pool) which works correctly
Solution:
- Use Executors.newCachedThreadPool() in tests instead of directExecutor
- Now runAsync() properly schedules work on background threads
- Vert.x worker threads don't block during consumer subscription
Evidence:
- test_sse_header_compliance and test_sse_event_format_compliance timed out
- Only on REST transport in CI (works locally, works on JSON-RPC/gRPC)
- Server logs show onMessageSendStream completing but client never receives response
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <[email protected]>1 parent a7bb042 commit a3f2721
File tree
1 file changed
+9
-6
lines changed- server-common/src/test/java/io/a2a/server/tasks
1 file changed
+9
-6
lines changedLines changed: 9 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| 14 | + | |
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | | - | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
44 | 47 | | |
45 | 48 | | |
46 | 49 | | |
47 | 50 | | |
48 | | - | |
| 51 | + | |
49 | 52 | | |
50 | 53 | | |
51 | 54 | | |
| |||
71 | 74 | | |
72 | 75 | | |
73 | 76 | | |
74 | | - | |
| 77 | + | |
75 | 78 | | |
76 | 79 | | |
77 | 80 | | |
| |||
82 | 85 | | |
83 | 86 | | |
84 | 87 | | |
85 | | - | |
| 88 | + | |
86 | 89 | | |
87 | 90 | | |
88 | 91 | | |
| |||
117 | 120 | | |
118 | 121 | | |
119 | 122 | | |
120 | | - | |
| 123 | + | |
121 | 124 | | |
122 | 125 | | |
123 | 126 | | |
| |||
177 | 180 | | |
178 | 181 | | |
179 | 182 | | |
180 | | - | |
| 183 | + | |
181 | 184 | | |
182 | 185 | | |
183 | 186 | | |
| |||
0 commit comments