diff --git a/pkg/services/rpcsrv/client_test.go b/pkg/services/rpcsrv/client_test.go index cd4b00a889..38fd101e4a 100644 --- a/pkg/services/rpcsrv/client_test.go +++ b/pkg/services/rpcsrv/client_test.go @@ -2212,6 +2212,10 @@ func TestWSClient_SubscriptionsCompat(t *testing.T) { // Accept the next block and wait for events. require.NoError(t, chain.AddBlock(b)) + // Blockchain's events channel is not buffered, and thus, by adding one more extra block + // we're ensuring that the previous block event receiving was successfully handled by Blockchain's + // notificationDispatcher loop. Once we're sure in that, we may start to check the actual notifications. + require.NoError(t, chain.AddBlock(b)) assert.Eventually(t, func() bool { lock.RLock() defer lock.RUnlock()