Actually need to wait to accumulate, make sure we get at least 8.

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2021-03-02 18:31:42 -08:00
parent df02e0be71
commit d084853aff

View File

@@ -2887,12 +2887,15 @@ func TestJetStreamClusterExtendedAccountInfo(t *testing.T) {
return info.JetStreamAccountStats
}
// Wait to accumulate.
time.Sleep(250 * time.Millisecond)
ai := getAccountInfo()
if ai.Streams != 3 || ai.Consumers != 3 {
t.Fatalf("AccountInfo not correct: %+v", ai)
}
if ai.API.Total < 9 {
t.Fatalf("Expected at least 9 total API calls, got %d", ai.API.Total)
if ai.API.Total < 8 {
t.Fatalf("Expected at least 8 total API calls, got %d", ai.API.Total)
}
// Now do a failure to make sure we track API errors.