MCPcopy Create free account
hub / github.com/stretchr/testify / TestEventuallyTimeout

Function TestEventuallyTimeout

assert/assertions_test.go:3090–3109  ·  view source on GitHub ↗

Check that a long running condition doesn't block Eventually. See issue 805 (and its long tail of following issues)

(t *testing.T)

Source from the content-addressed store, hash-verified

3088// Check that a long running condition doesn't block Eventually.
3089// See issue 805 (and its long tail of following issues)
3090func 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
3111func Test_validateEqualArgs(t *testing.T) {
3112 if validateEqualArgs(func() {}, func() {}) == nil {

Callers

nothing calls this directly

Calls 3

NotPanicsFunction · 0.70
FalseFunction · 0.70
EventuallyFunction · 0.70

Tested by

no test coverage detected