Check that a long running condition doesn't block Eventually. See issue 805 (and its long tail of following issues)
(t *testing.T)
| 2874 | // Check that a long running condition doesn't block Eventually. |
| 2875 | // See issue 805 (and its long tail of following issues) |
| 2876 | func TestEventuallyTimeout(t *testing.T) { |
| 2877 | mockT := new(testing.T) |
| 2878 | |
| 2879 | NotPanics(t, func() { |
| 2880 | done, done2 := make(chan struct{}), make(chan struct{}) |
| 2881 | |
| 2882 | // A condition function that returns after the Eventually timeout |
| 2883 | condition := func() bool { |
| 2884 | // Wait until Eventually times out and terminates |
| 2885 | <-done |
| 2886 | close(done2) |
| 2887 | return true |
| 2888 | } |
| 2889 | |
| 2890 | False(t, Eventually(mockT, condition, time.Millisecond, time.Microsecond)) |
| 2891 | |
| 2892 | close(done) |
| 2893 | <-done2 |
| 2894 | }) |
| 2895 | } |
| 2896 | |
| 2897 | func Test_validateEqualArgs(t *testing.T) { |
| 2898 | if validateEqualArgs(func() {}, func() {}) == nil { |
nothing calls this directly
no test coverage detected
searching dependent graphs…