Check that a long running condition doesn't block Eventually. See issue 805 (and its long tail of following issues)
(t *testing.T)
| 3088 | // Check that a long running condition doesn't block Eventually. |
| 3089 | // See issue 805 (and its long tail of following issues) |
| 3090 | func TestEventuallyTimeout(t *testing.T) { |
| 3091 | mockT := new(testing.T) |
| 3092 | |
| 3093 | NotPanics(t, func() { |
| 3094 | done, done2 := make(chan struct{}), make(chan struct{}) |
| 3095 | |
| 3096 | // A condition function that returns after the Eventually timeout |
| 3097 | condition := func() bool { |
| 3098 | // Wait until Eventually times out and terminates |
| 3099 | <-done |
| 3100 | close(done2) |
| 3101 | return true |
| 3102 | } |
| 3103 | |
| 3104 | False(t, Eventually(mockT, condition, time.Millisecond, time.Microsecond)) |
| 3105 | |
| 3106 | close(done) |
| 3107 | <-done2 |
| 3108 | }) |
| 3109 | } |
| 3110 | |
| 3111 | func Test_validateEqualArgs(t *testing.T) { |
| 3112 | if validateEqualArgs(func() {}, func() {}) == nil { |
nothing calls this directly
no test coverage detected