Fixed flapper

Signed-off-by: Ivan Kozlovic <ivan@synadia.com>
This commit is contained in:
Ivan Kozlovic
2020-06-12 16:51:40 -06:00
parent 61cccbce02
commit b36672a6bc

View File

@@ -2158,10 +2158,15 @@ func TestLeafNodeConnectionLimitsSingleServer(t *testing.T) {
checkAccConnectionCounts(t, 2)
// Make sure s4 has 0 still.
if nln := s4.NumLeafNodes(); nln != 0 {
t.Fatalf("Expected no leafnodes accounted for in s4, got %d", nln)
}
// Make sure s4 has 0 still. We need checkFor because it is possible
// that when we check we have actually the connection registered for
// a short period before it is closed due to limit.
checkFor(t, time.Second, 15*time.Millisecond, func() error {
if nln := s4.NumLeafNodes(); nln != 0 {
return fmt.Errorf("Expected no leafnodes accounted for in s4, got %d", nln)
}
return nil
})
// Make sure this is still 2.
checkLeafNodeConnections(t, s, 2)