MCPcopy
hub / github.com/stretchr/testify / TestEventuallyTimeout

Function TestEventuallyTimeout

assert/assertions_test.go:3494–3515  ·  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

3492// Check that a long running condition doesn't block Eventually.
3493// See issue 805 (and its long tail of following issues)
3494func 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
3517func TestEventuallySucceedQuickly(t *testing.T) {
3518 t.Parallel()

Callers

nothing calls this directly

Calls 3

NotPanicsFunction · 0.70
FalseFunction · 0.70
EventuallyFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…