mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-02 11:48:43 -07:00
Use waitForClientConnCount() in TestConnzTLSInHandshake()
Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user