From 0a5dd068b133efa2e35b67cea158e50c53f701ac Mon Sep 17 00:00:00 2001 From: Naiyuan Qing <145280634+NevilleQingNY@users.noreply.github.com> Date: Wed, 25 Mar 2026 17:15:23 +0800 Subject: [PATCH] fix(test): add sleep after WS connect for Hub register timing The Hub processes client registration asynchronously via a channel. Without a short delay, the issue creation can fire before the client is added to the workspace room, so the broadcast has no recipients. Co-Authored-By: Claude Opus 4.6 (1M context) --- server/cmd/server/integration_test.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/server/cmd/server/integration_test.go b/server/cmd/server/integration_test.go index 21191d77..713ab2ee 100644 --- a/server/cmd/server/integration_test.go +++ b/server/cmd/server/integration_test.go @@ -717,6 +717,9 @@ func TestWebSocketIntegration(t *testing.T) { } defer conn.Close() + // Allow Hub goroutine to process the register and add client to room + time.Sleep(100 * time.Millisecond) + // Create an issue — this should trigger a WebSocket broadcast resp := authRequest(t, "POST", "/api/issues?workspace_id="+testWorkspaceID, map[string]any{ "title": "WebSocket test issue",