(t *testing.T, totalWait, sleepDur time.Duration, f func() error)
| 323 | } |
| 324 | |
| 325 | func checkFor(t *testing.T, totalWait, sleepDur time.Duration, f func() error) { |
| 326 | t.Helper() |
| 327 | timeout := time.Now().Add(totalWait) |
| 328 | var err error |
| 329 | for time.Now().Before(timeout) { |
| 330 | err = f() |
| 331 | if err == nil { |
| 332 | return |
| 333 | } |
| 334 | time.Sleep(sleepDur) |
| 335 | } |
| 336 | if err != nil { |
| 337 | t.Fatal(err.Error()) |
| 338 | } |
| 339 | } |
no test coverage detected