Commit e17e9fe
committed
fix: keep the test Client alive past the connect() success signal
Found the actual root cause of the remaining CI flake: `client` was
constructed and dropped inside the innermost closure, so it closed its
TCP connection immediately after connect() returned Ok -- before (or
racing) the setup_tx notification the driver loop was waiting on. If the
driver loop's next server.poll() ran before it saw that notification, it
could observe and process the resulting disconnect, evicting the
connection from server.connections before the test ever got to assert on
it (reproduced in CI as `left: 0, right: 1` in ~1.8s, i.e. not a timeout).
Move `client` out to the thread closure's own scope so it stays connected
through the success signal and the driver loop's final break -- no
poll() call happens after that point, so the connection can no longer be
raced away. Verified stable over 10 runs locally, both with default and
--test-threads=1 parallelism (the mode the failing CI job used).
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015ZRH22k5s8VSoSJgUXa2wd1 parent 76750b5 commit e17e9fe
1 file changed
Lines changed: 13 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
380 | 380 | | |
381 | 381 | | |
382 | 382 | | |
383 | | - | |
384 | | - | |
385 | | - | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
390 | | - | |
391 | | - | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
392 | 396 | | |
393 | 397 | | |
394 | 398 | | |
| |||
0 commit comments