diff --git a/pkg/rpcclient/wsclient_test.go b/pkg/rpcclient/wsclient_test.go index 7f3db1d27e..b1f8bcf64e 100644 --- a/pkg/rpcclient/wsclient_test.go +++ b/pkg/rpcclient/wsclient_test.go @@ -345,7 +345,13 @@ func TestWSClientNonBlockingEvents(t *testing.T) { return blocksSent.Load() }, time.Second, 100*time.Millisecond) - // Check that block receiver channel was removed from the receivers list due to overflow. + // Check that block receiver channel is full. + require.Eventually(t, func() bool { + return len(bCh) == chCap + }, 2*time.Second, 200*time.Millisecond) + + // Check that block receiver channel was removed from the receivers list due + // to overflow. require.Eventually(t, func() bool { wsc.subscriptionsLock.RLock() defer wsc.subscriptionsLock.RUnlock()