From 65f56c858f97b1fe6689e94ef2a86c62ccbe8b1e Mon Sep 17 00:00:00 2001 From: Anna Shaleva Date: Tue, 12 Mar 2024 11:28:36 +0300 Subject: [PATCH] rpcsrv: improve TestWSClient_SubscriptionsCompat Close exit channel on exit, wait more for the test to finish. Ref. #2956. Signed-off-by: Anna Shaleva --- pkg/services/rpcsrv/client_test.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/services/rpcsrv/client_test.go b/pkg/services/rpcsrv/client_test.go index 3317c7807..87eef8bb1 100644 --- a/pkg/services/rpcsrv/client_test.go +++ b/pkg/services/rpcsrv/client_test.go @@ -2122,6 +2122,7 @@ func TestWSClient_SubscriptionsCompat(t *testing.T) { ntfFlt = &neorpc.NotificationFilter{Name: &ntfName} aerFlt = &neorpc.ExecutionFilter{State: &st} } + bID, err = c.ReceiveBlocks(bFlt, blockCh) require.NoError(t, err) txID, err = c.ReceiveTransactions(txFlt, txCh) @@ -2184,13 +2185,13 @@ func TestWSClient_SubscriptionsCompat(t *testing.T) { defer lock.RUnlock() return received == 1<<4-1 - }, time.Second, 100*time.Millisecond) + }, 2*time.Second, 100*time.Millisecond) require.NoError(t, c.Unsubscribe(bID)) require.NoError(t, c.Unsubscribe(txID)) require.NoError(t, c.Unsubscribe(ntfID)) require.NoError(t, c.Unsubscribe(aerID)) - exitCh <- struct{}{} + close(exitCh) } t.Run("relevant, filtered", func(t *testing.T) { checkRelevant(t, true)