diff --git a/assert/assertion_format.go b/assert/assertion_format.go index a19a89279..eba28af67 100644 --- a/assert/assertion_format.go +++ b/assert/assertion_format.go @@ -192,8 +192,11 @@ func Eventuallyf(t TestingT, condition func() bool, waitFor time.Duration, tick // }() // assert.EventuallyWithTf(t, func(c *assert.CollectT) { // // add assertions as needed; any assertion failure will fail the current tick -// assert.True(c, externalValue, "expected 'externalValue' to be true") -// }, 10*time.Second, 1*time.Second, "error message %s", "formatted") +// assert.True(c, externalValue) +// }, 10*time.Second, 1*time.Second, "externalValue was not true before timeout") +// +// The msg and args format the failure when the condition is never met; they are +// not passed to the condition callback. func EventuallyWithTf(t TestingT, condition func(collect *CollectT), waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) bool { if h, ok := t.(tHelper); ok { h.Helper() diff --git a/assert/assertion_forward.go b/assert/assertion_forward.go index cd2a86061..7bb8ade65 100644 --- a/assert/assertion_forward.go +++ b/assert/assertion_forward.go @@ -374,8 +374,11 @@ func (a *Assertions) EventuallyWithT(condition func(collect *CollectT), waitFor // }() // a.EventuallyWithTf(func(c *assert.CollectT) { // // add assertions as needed; any assertion failure will fail the current tick -// assert.True(c, externalValue, "expected 'externalValue' to be true") -// }, 10*time.Second, 1*time.Second, "error message %s", "formatted") +// assert.True(c, externalValue) +// }, 10*time.Second, 1*time.Second, "externalValue was not true before timeout") +// +// The msg and args format the failure when the condition is never met; they are +// not passed to the condition callback. func (a *Assertions) EventuallyWithTf(condition func(collect *CollectT), waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) bool { if h, ok := a.t.(tHelper); ok { h.Helper() diff --git a/require/require.go b/require/require.go index 652871f2e..b3a3e73b9 100644 --- a/require/require.go +++ b/require/require.go @@ -459,8 +459,11 @@ func EventuallyWithT(t TestingT, condition func(collect *assert.CollectT), waitF // }() // require.EventuallyWithTf(t, func(c *assert.CollectT) { // // add assertions as needed; any assertion failure will fail the current tick -// require.True(c, externalValue, "expected 'externalValue' to be true") -// }, 10*time.Second, 1*time.Second, "error message %s", "formatted") +// require.True(c, externalValue) +// }, 10*time.Second, 1*time.Second, "externalValue was not true before timeout") +// +// The msg and args format the failure when the condition is never met; they are +// not passed to the condition callback. func EventuallyWithTf(t TestingT, condition func(collect *assert.CollectT), waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) { if h, ok := t.(tHelper); ok { h.Helper() diff --git a/require/require_forward.go b/require/require_forward.go index edac147ef..0ab28d7c6 100644 --- a/require/require_forward.go +++ b/require/require_forward.go @@ -375,8 +375,11 @@ func (a *Assertions) EventuallyWithT(condition func(collect *assert.CollectT), w // }() // a.EventuallyWithTf(func(c *assert.CollectT) { // // add assertions as needed; any assertion failure will fail the current tick -// assert.True(c, externalValue, "expected 'externalValue' to be true") -// }, 10*time.Second, 1*time.Second, "error message %s", "formatted") +// assert.True(c, externalValue) +// }, 10*time.Second, 1*time.Second, "externalValue was not true before timeout") +// +// The msg and args format the failure when the condition is never met; they are +// not passed to the condition callback. func (a *Assertions) EventuallyWithTf(condition func(collect *assert.CollectT), waitFor time.Duration, tick time.Duration, msg string, args ...interface{}) { if h, ok := a.t.(tHelper); ok { h.Helper()