From cb1c2e7352d8d76cfe93ea08bea377df30f7ea08 Mon Sep 17 00:00:00 2001 From: Ivan Kozlovic Date: Tue, 26 Jun 2018 19:42:55 -0600 Subject: [PATCH] Use waitForClientConnCount() in TestConnzTLSInHandshake() Signed-off-by: Ivan Kozlovic --- server/monitor_test.go | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) diff --git a/server/monitor_test.go b/server/monitor_test.go index dd080ca6..a233bf69 100644 --- a/server/monitor_test.go +++ b/server/monitor_test.go @@ -1437,18 +1437,7 @@ func TestConnzTLSInHandshake(t *testing.T) { defer c.Close() // Wait for the connection to be registered - timeout := time.Now().Add(2 * time.Second) - cc := 0 - for time.Now().Before(timeout) { - cc = s.NumClients() - if cc == 1 { - break - } - time.Sleep(15 * time.Millisecond) - } - if cc != 1 { - t.Fatalf("Expected 1 client, got %v", cc) - } + waitForClientConnCount(t, s, 1) start := time.Now() endpoint := fmt.Sprintf("http://%s:%d/connz", opts.HTTPHost, s.MonitorAddr().Port)