diff --git a/cmd/pulse/commands_test.go b/cmd/pulse/commands_test.go index 88229de06..53487ec8b 100644 --- a/cmd/pulse/commands_test.go +++ b/cmd/pulse/commands_test.go @@ -866,6 +866,11 @@ func TestRunServer_WebSocket(t *testing.T) { t.Logf("WS Read Error: %v", err) } } + + // Explicitly cancel and wait for server shutdown before test cleanup + // to avoid race condition where server writes files during temp dir removal + cancel() + time.Sleep(200 * time.Millisecond) } func TestRunServer_AllowedOrigins(t *testing.T) {