@@ -404,6 +404,10 @@ func Errorf(t TestingT, err error, msg string, args ...interface{}) {
404404// Eventually asserts that given condition will be met in waitFor time,
405405// periodically checking target function each tick.
406406//
407+ // If the condition does not return normally, but instead calls [runtime.Goexit],
408+ // the assertion fails immediately. This usually means that the condition called
409+ // t.FailNow() on the outer 't'.
410+ //
407411// require.Eventually(t, func() bool { return true; }, time.Second, 10*time.Millisecond)
408412func Eventually (t TestingT , condition func () bool , waitFor time.Duration , tick time.Duration , msgAndArgs ... interface {}) {
409413 if h , ok := t .(tHelper ); ok {
@@ -424,6 +428,12 @@ func Eventually(t TestingT, condition func() bool, waitFor time.Duration, tick t
424428// If the condition is not met before waitFor, the collected errors of
425429// the last tick are copied to t.
426430//
431+ // If the condition does not return normally, but instead calls [runtime.Goexit],
432+ // and the exit was not via 'collect.FailNow()', the assertion fails immediately.
433+ // This usually means that the condition called t.FailNow() on the outer 't'.
434+ // Use [CollectT.FailNow] or 'require' functions on the provided 'collect' to
435+ // only fail the current tick.
436+ //
427437// externalValue := false
428438// go func() {
429439// time.Sleep(8*time.Second)
@@ -452,6 +462,12 @@ func EventuallyWithT(t TestingT, condition func(collect *assert.CollectT), waitF
452462// If the condition is not met before waitFor, the collected errors of
453463// the last tick are copied to t.
454464//
465+ // If the condition does not return normally, but instead calls [runtime.Goexit],
466+ // and the exit was not via 'collect.FailNow()', the assertion fails immediately.
467+ // This usually means that the condition called t.FailNow() on the outer 't'.
468+ // Use [CollectT.FailNow] or 'require' functions on the provided 'collect' to
469+ // only fail the current tick.
470+ //
455471// externalValue := false
456472// go func() {
457473// time.Sleep(8*time.Second)
@@ -474,6 +490,10 @@ func EventuallyWithTf(t TestingT, condition func(collect *assert.CollectT), wait
474490// Eventuallyf asserts that given condition will be met in waitFor time,
475491// periodically checking target function each tick.
476492//
493+ // If the condition does not return normally, but instead calls [runtime.Goexit],
494+ // the assertion fails immediately. This usually means that the condition called
495+ // t.FailNow() on the outer 't'.
496+ //
477497// require.Eventuallyf(t, func() bool { return true; }, time.Second, 10*time.Millisecond, "error message %s", "formatted")
478498func Eventuallyf (t TestingT , condition func () bool , waitFor time.Duration , tick time.Duration , msg string , args ... interface {}) {
479499 if h , ok := t .(tHelper ); ok {
@@ -1310,6 +1330,10 @@ func Negativef(t TestingT, e interface{}, msg string, args ...interface{}) {
13101330// Never asserts that the given condition doesn't satisfy in waitFor time,
13111331// periodically checking the target function each tick.
13121332//
1333+ // If the condition does not return normally, but instead calls [runtime.Goexit],
1334+ // the assertion fails immediately. This usually means that the condition called
1335+ // t.FailNow() on the outer 't'.
1336+ //
13131337// require.Never(t, func() bool { return false; }, time.Second, 10*time.Millisecond)
13141338func Never (t TestingT , condition func () bool , waitFor time.Duration , tick time.Duration , msgAndArgs ... interface {}) {
13151339 if h , ok := t .(tHelper ); ok {
@@ -1324,6 +1348,10 @@ func Never(t TestingT, condition func() bool, waitFor time.Duration, tick time.D
13241348// Neverf asserts that the given condition doesn't satisfy in waitFor time,
13251349// periodically checking the target function each tick.
13261350//
1351+ // If the condition does not return normally, but instead calls [runtime.Goexit],
1352+ // the assertion fails immediately. This usually means that the condition called
1353+ // t.FailNow() on the outer 't'.
1354+ //
13271355// require.Neverf(t, func() bool { return false; }, time.Second, 10*time.Millisecond, "error message %s", "formatted")
13281356func Neverf (t TestingT , condition func () bool , waitFor time.Duration , tick time.Duration , msg string , args ... interface {}) {
13291357 if h , ok := t .(tHelper ); ok {
0 commit comments