all: fix goroutine leaks in unit tests by adding 1-elem channel buffer (#20666)
This fixes a bunch of cases where a timeout in the test would leak a goroutine.
This commit is contained in:
@ -670,7 +670,7 @@ func TestBroadcastMalformedBlock(t *testing.T) {
|
||||
malformedEverything.TxHash[0]++
|
||||
|
||||
// Keep listening to broadcasts and notify if any arrives
|
||||
notify := make(chan struct{})
|
||||
notify := make(chan struct{}, 1)
|
||||
go func() {
|
||||
if _, err := sink.app.ReadMsg(); err == nil {
|
||||
notify <- struct{}{}
|
||||
|
Reference in New Issue
Block a user