Use waitForClientConnCount() in TestConnzTLSInHandshake()

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
This commit is contained in:
Ivan Kozlovic
2018-06-26 19:42:55 -06:00
parent 093ced686a
commit cb1c2e7352

View File

@@ -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)