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 flakyness
Solution
Add a waitgroup potentially so that this channel close waits for the gofunc writing to the channel completes.