Open cszczepaniak opened 11 months ago
I think this is a good behavior change.
We must involve people who designed it.
This would be addressed by the proposal in https://github.com/stretchr/testify/issues/1439 if that were to move forward.
👋 Hey @dolmen @cszczepaniak, any update on this ? Would you consider a PR fixing this specifically ? (without necessarily going with the bigger https://github.com/stretchr/testify/issues/1439)
I work on a project where Eventually
is used pretty extensively in e2e tests where the tick is often in the order of several seconds, so this would be a great improvement duration-wise !
I would still be willing to make this change if everybody is in agreement.
Works for me, as long as this is fixed ! I didn't notice you already had a PR opened by the way 😄
@dolmen @pgimalac https://github.com/stretchr/testify/pull/1427 is now rebased and cleaned up. Ready for review again!
@cszczepaniak I just merged #1481 which uses runtime.Goexit
if FailNow
is called from the condition
. The single goroutine approach seems incompatible.
@dolmen commented on the PR as well, but checking the condition first doesn't require the single goroutine change (which is #1439) so I still think addressing this issue is worthwhile, but possibly we should just close #1439
assert.Eventually
does not check initially whether the condition is satisfied. This means it must wait a minimum of the tick duration before checking the condition for the first time. It would be a nice optimization to early-out if the condition is met already when the function is called.