cultnet-ts test: reconnecting client sends only after its own handshake #113

Merged
libby merged 1 commit from rudp-flake into main 2026-11-11 16:05:37 +00:00
Member

Closes variants:follow_up:cultnet-ts-rudp-reconnect-flake.

a client reconnecting from the same endpoint replaces only its own session (packages/cultnet-ts/test/rudp-server.test.ts) failed in forge run 1331 with Cannot send RUDP data before the session is connected. The test waited for the server to accept the reconnect (connected.length === 3) and then sent from the client; the client's new session is connected only when it hears the Accept, so the send raced it. Not a client bug: connect() starts a new session generation and send refusing before it connects is the contract. The test now waits on a.connection.connected before sending. Two lines, test only.

Could not reproduce locally in 40 serial runs or 60 runs under CPU load (loopback is too quick); the race is read from the code path and the CI failure.

🤖 Generated with Claude Code

Closes variants:follow_up:cultnet-ts-rudp-reconnect-flake. `a client reconnecting from the same endpoint replaces only its own session` (packages/cultnet-ts/test/rudp-server.test.ts) failed in forge run 1331 with `Cannot send RUDP data before the session is connected`. The test waited for the *server* to accept the reconnect (`connected.length === 3`) and then sent from the client; the client's new session is connected only when it hears the Accept, so the send raced it. Not a client bug: `connect()` starts a new session generation and `send` refusing before it connects is the contract. The test now waits on `a.connection.connected` before sending. Two lines, test only. Could not reproduce locally in 40 serial runs or 60 runs under CPU load (loopback is too quick); the race is read from the code path and the CI failure. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
cultnet-ts test: the reconnecting client sends only after its own handshake completes
Some checks failed
CultMesh portability and performance / ubuntu-latest reactive semantics and leases (pull_request) Has been cancelled
529fcd92a0
The server accepting the reconnect is not the client hearing the Accept; sending in
that window throws 'before the session is connected' (forge run 1331).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
libby merged commit 8beb972c68 into main 2026-11-11 16:05:37 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
GameCult/CultLib!113
No description provided.