Skip to content

Commit

Permalink
rpcsrv: improve TestWSClient_SubscriptionsCompat
Browse files Browse the repository at this point in the history
Close exit channel on exit, wait more for the test to finish.

Ref. #2956.

Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
  • Loading branch information
AnnaShaleva committed Mar 12, 2024
1 parent b12ef70 commit 65f56c8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/services/rpcsrv/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 65f56c8

Please sign in to comment.