Skip to content

Fix the flaky WebSocket tunnel server_list test - #5

Merged
rune-oai merged 1 commit into
mainfrom
update/tunnel-flake
Nov 16, 2026
Merged

rune-oai merged 1 commit into
mainfrom
update/tunnel-flake

Conversation

@rune-oai

Copy link
Copy Markdown
Owner

CI failed on main (run 43820507967): TestServerWebsocketTunnel_EndToEndAndTenantIsolation read an empty initial server_list.

The hub registers a server peer only after writing the WebSocket handshake response, so a client that dials right after the server can subscribe before the server is visible. The test now waits for each server to appear (through a short-lived probe client's server_list / server_online events) before the client under test subscribes. TestServerWebsocketTunnel_HotReloadRevokesRemovedKeyOnly had the same race and gets the same wait.

Test-only change. Verified with go test -race -count=50 -cpu 1,4 -run TestServerWebsocketTunnel ./internal/api/ and a full go test ./internal/api/.

🤖 Generated with Claude Code

The hub registers a server peer only after it has written the WebSocket
handshake response, so a client that dials right after the server can get
an initial server_list without it. CI hit this once on main
(TestServerWebsocketTunnel_EndToEndAndTenantIsolation saw an empty list).

Wait for each server to appear, through a short-lived probe client's
server_list or server_online events, before the client under test
subscribes. The hot-reload test had the same race and gets the same wait.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rune-oai
rune-oai merged commit 6a22e79 into main Nov 16, 2026
6 checks passed
@rune-oai
rune-oai deleted the update/tunnel-flake branch November 16, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant