diff options
author | Emiliano Ciavatta | 2020-04-10 08:30:20 +0000 |
---|---|---|
committer | Emiliano Ciavatta | 2020-04-10 08:30:20 +0000 |
commit | 25bd17a2147d7169695772c2a887cdd54caff770 (patch) | |
tree | 7ed9d861b9ade3f81a9ca851684b74a7754c643d | |
parent | 1235710ae3b52e64f2639fc08e8219e5e70ea982 (diff) |
Add timeout to connection_handler_test
-rw-r--r-- | connection_handler_test.go | 8 |
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) |