Commit 83134af
fix: Await each WebSocket client send in tests to fix flaky fragmented-message test (#651)
## Why
The `Scala 3` CI job failed on PR #650 with a flaky `WebSocketTest`
failure:
```
- fragmented text messages are aggregated: Expected <len:12> but got <null> (WebSocketTest.scala:219) (12.01s)
```
The JDK `java.net.http.WebSocket` client rejects a new send while a
previous send is still pending. The test called `sendText("first-",
false)` and `sendText("second", true)` back-to-back without awaiting the
returned futures, so under scheduling pressure the final fragment is
dropped, the server-side aggregator never sees a complete message, and
`nextText` times out returning `null`.
## What
Await each `sendText` future (`.get(10, TimeUnit.SECONDS)`) before the
next send in the fragmented-message and echo tests. Verified locally:
all 12 `WebSocketTest` tests pass, `scalafmtCheckAll` clean.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>1 parent e589a75 commit 83134af
1 file changed
Lines changed: 7 additions & 5 deletions
Lines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
137 | 137 | | |
138 | 138 | | |
139 | 139 | | |
140 | | - | |
| 140 | + | |
141 | 141 | | |
142 | | - | |
| 142 | + | |
143 | 143 | | |
144 | 144 | | |
145 | 145 | | |
| |||
213 | 213 | | |
214 | 214 | | |
215 | 215 | | |
216 | | - | |
217 | | - | |
218 | | - | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
219 | 221 | | |
220 | 222 | | |
221 | 223 | | |
| |||
0 commit comments