test(agent): fix channel timeout in TestNewServer_CloseActiveConnections (#17690)

This fixes a test issue where we were waiting on a channel indefinitely
and the test timed out instead of failing due to earlier error.

Updates coder/internal#558
This commit is contained in:
Mathias Fredriksson
2025-05-06 14:20:28 +03:00
committed by GitHub
parent ec003b7cf9
commit ebad5c3ed0

View File

@ -214,7 +214,11 @@ func TestNewServer_CloseActiveConnections(t *testing.T) {
} }
for _, ch := range waitConns { for _, ch := range waitConns {
<-ch select {
case <-ctx.Done():
t.Fatal("timeout")
case <-ch:
}
} }
return s, wg.Wait return s, wg.Wait