-
Notifications
You must be signed in to change notification settings - Fork 1.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
assert.Eventually with low ticks cause panic: send on closed channel #805
Labels
assert.Eventually
About assert.Eventually/EventuallyWithT
bug
pkg-assert
Change related to package testify/assert
Comments
jszwec
added a commit
to jszwec/testify
that referenced
this issue
Aug 29, 2019
jszwec
added a commit
to jszwec/testify
that referenced
this issue
Aug 29, 2019
Same for me. To reproduce:
|
jszwec
added a commit
to jszwec/testify
that referenced
this issue
Nov 6, 2019
Teelevision
pushed a commit
to pace/bricks
that referenced
this issue
Mar 10, 2020
The version we were using had a bug in the Eventually function that affected the routine package. stretchr/testify#805
This was referenced Jul 6, 2023
dolmen
added
bug
pkg-assert
Change related to package testify/assert
assert.Eventually
About assert.Eventually/EventuallyWithT
labels
Jul 31, 2023
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
assert.Eventually
About assert.Eventually/EventuallyWithT
bug
pkg-assert
Change related to package testify/assert
Setup
If you put an:
assert.Eventually(t, func() bool { return true }, time.Millisecond, 50 * time.Microsecond)
inside your test, you will get flaky results and more often then not, you will get a panic:panic: send on closed channel
Workaround
Increasing the tick to around
100 * time.Microsecond
removes the flakynessSolution
Add a waitgroup potentially so that this channel close waits for the gofunc writing to the channel completes.
The text was updated successfully, but these errors were encountered: