testify
testify copied to clipboard
`Eventually`/`EventuallyWithT` should only use one goroutine
Currently, Eventually
and EventuallyWithT
spin up a goroutine per condition check. It also sets the ticker channel to nil
while the condition is being checked, which makes it hard to understand to readers that the select
will never hit case <-tick
while the condition is running.
A better implementation may be to spin up a single goroutine which polls the condition repeatedly while the function waits on the result or a timeout.
This would also solve #1424 if implemented correctly.