(t *testing.T, totalWait, sleepDur time.Duration, f func() error)
| 6593 | } |
| 6594 | |
| 6595 | func checkFor(t *testing.T, totalWait, sleepDur time.Duration, f func() error) { |
| 6596 | t.Helper() |
| 6597 | timeout := time.Now().Add(totalWait) |
| 6598 | var err error |
| 6599 | for time.Now().Before(timeout) { |
| 6600 | err = f() |
| 6601 | if err == nil { |
| 6602 | return |
| 6603 | } |
| 6604 | time.Sleep(sleepDur) |
| 6605 | } |
| 6606 | if err != nil { |
| 6607 | t.Fatal(err.Error()) |
| 6608 | } |
| 6609 | } |
| 6610 | |
| 6611 | func checkSubsPending(t *testing.T, sub *nats.Subscription, numExpected int) { |
| 6612 | t.Helper() |
no test coverage detected