Updates based on code review

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
This commit is contained in:
Ivan Kozlovic
2020-02-19 16:52:41 -07:00
parent 8e4b449119
commit 156bf7b381
2 changed files with 8 additions and 7 deletions

View File

@@ -816,7 +816,7 @@ func TestSystemAccountSystemConnectionLimitsHonored(t *testing.T) {
// The account's connection count is exchanged between servers
// so that the local count on each server reflects the total count.
// Pause a bit to give a change for each server to process the update.
// Pause a bit to give a chance to each server to process the update.
time.Sleep(15 * time.Millisecond)
}
if tc != 10 {

View File

@@ -707,14 +707,15 @@ func TestLameDuckMode(t *testing.T) {
if n := len(cz.Conns); n != total {
return fmt.Errorf("expected %v closed connections, got %v", total, n)
}
for _, c := range cz.Conns {
if !strings.Contains(c.Reason, ServerShutdown.String()) {
return fmt.Errorf("expected closed connection with `%s` state, got `%s`",
ServerShutdown.String(), c.Reason)
}
}
return nil
})
cz := pollConz(t, srvA, 1, "", &ConnzOptions{State: ConnClosed})
if n := len(cz.Conns); n != total {
t.Fatalf("Expected %v closed connections, got %v", total, n)
}
for _, c := range cz.Conns {
checkReason(t, c.Reason, ServerShutdown)
}
stopClientsAndSrvB(ncs)