Fix flapping test

Signed-off-by: Derek Collison <derek@nats.io>
This commit is contained in:
Derek Collison
2023-04-08 21:58:54 -07:00
parent 313dd424a3
commit aee73a9c77

View File

@@ -3800,10 +3800,12 @@ func TestNoRaceJetStreamClusterStreamReset(t *testing.T) {
return err
})
// Grab number go routines.
if after := runtime.NumGoroutine(); base > after {
t.Fatalf("Expected %d go routines, got %d", base, after)
}
checkFor(t, 5*time.Second, 200*time.Millisecond, func() error {
if after := runtime.NumGoroutine(); base > after {
return fmt.Errorf("Expected %d go routines, got %d", base, after)
}
return nil
})
// Simulate a low level write error on our consumer and make sure we can recover etc.
cl = c.consumerLeader("$G", "TEST", "d1")