Skip to content

Commit ebad5c3

Browse files
authored
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
1 parent ec003b7 commit ebad5c3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

agent/agentssh/agentssh_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,11 @@ func TestNewServer_CloseActiveConnections(t *testing.T) {
214214
}
215215

216216
for _, ch := range waitConns {
217-
<-ch
217+
select {
218+
case <-ctx.Done():
219+
t.Fatal("timeout")
220+
case <-ch:
221+
}
218222
}
219223

220224
return s, wg.Wait

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy