aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--connection_handler_test.go8
1 files changed, 7 insertions, 1 deletions
diff --git a/connection_handler_test.go b/connection_handler_test.go
index 85aee0c..aefa058 100644
--- a/connection_handler_test.go
+++ b/connection_handler_test.go
@@ -154,8 +154,14 @@ func TestConnectionFactory(t *testing.T) {
go testInteraction(serverClientNetFlow, serverClientTransportFlow, otherSeenChan, completed)
}
+ timeout := time.Tick(1 * time.Second)
for i := 0; i < n; i++ {
- <-completed
+ select {
+ case <- completed:
+ continue
+ case <- timeout:
+ t.Fatal("timeout")
+ }
}
assert.Len(t, factory.connections, 0)