Check that a long running condition doesn't block Eventually. See issue 805 (and its long tail of following issues)
(t *testing.T)
| 3492 | // Check that a long running condition doesn't block Eventually. |
| 3493 | // See issue 805 (and its long tail of following issues) |
| 3494 | func TestEventuallyTimeout(t *testing.T) { |
| 3495 | t.Parallel() |
| 3496 | |
| 3497 | mockT := new(testing.T) |
| 3498 | |
| 3499 | NotPanics(t, func() { |
| 3500 | done, done2 := make(chan struct{}), make(chan struct{}) |
| 3501 | |
| 3502 | // A condition function that returns after the Eventually timeout |
| 3503 | condition := func() bool { |
| 3504 | // Wait until Eventually times out and terminates |
| 3505 | <-done |
| 3506 | close(done2) |
| 3507 | return true |
| 3508 | } |
| 3509 | |
| 3510 | False(t, Eventually(mockT, condition, time.Millisecond, time.Microsecond)) |
| 3511 | |
| 3512 | close(done) |
| 3513 | <-done2 |
| 3514 | }) |
| 3515 | } |
| 3516 | |
| 3517 | func TestEventuallySucceedQuickly(t *testing.T) { |
| 3518 | t.Parallel() |
nothing calls this directly
no test coverage detected
searching dependent graphs…