mirror of
https://github.com/nspcc-dev/neo-go.git
synced 2024-11-21 23:29:38 +00:00
rpcsrv: improve TestWSClient_SubscriptionsCompat
Close exit channel on exit, wait more for the test to finish. Ref. #2956. Signed-off-by: Anna Shaleva <shaleva.ann@nspcc.ru>
This commit is contained in:
parent
b12ef701f0
commit
65f56c858f
1 changed files with 3 additions and 2 deletions
|
@ -2122,6 +2122,7 @@ func TestWSClient_SubscriptionsCompat(t *testing.T) {
|
||||||
ntfFlt = &neorpc.NotificationFilter{Name: &ntfName}
|
ntfFlt = &neorpc.NotificationFilter{Name: &ntfName}
|
||||||
aerFlt = &neorpc.ExecutionFilter{State: &st}
|
aerFlt = &neorpc.ExecutionFilter{State: &st}
|
||||||
}
|
}
|
||||||
|
|
||||||
bID, err = c.ReceiveBlocks(bFlt, blockCh)
|
bID, err = c.ReceiveBlocks(bFlt, blockCh)
|
||||||
require.NoError(t, err)
|
require.NoError(t, err)
|
||||||
txID, err = c.ReceiveTransactions(txFlt, txCh)
|
txID, err = c.ReceiveTransactions(txFlt, txCh)
|
||||||
|
@ -2184,13 +2185,13 @@ func TestWSClient_SubscriptionsCompat(t *testing.T) {
|
||||||
defer lock.RUnlock()
|
defer lock.RUnlock()
|
||||||
|
|
||||||
return received == 1<<4-1
|
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(bID))
|
||||||
require.NoError(t, c.Unsubscribe(txID))
|
require.NoError(t, c.Unsubscribe(txID))
|
||||||
require.NoError(t, c.Unsubscribe(ntfID))
|
require.NoError(t, c.Unsubscribe(ntfID))
|
||||||
require.NoError(t, c.Unsubscribe(aerID))
|
require.NoError(t, c.Unsubscribe(aerID))
|
||||||
exitCh <- struct{}{}
|
close(exitCh)
|
||||||
}
|
}
|
||||||
t.Run("relevant, filtered", func(t *testing.T) {
|
t.Run("relevant, filtered", func(t *testing.T) {
|
||||||
checkRelevant(t, true)
|
checkRelevant(t, true)
|
||||||
|
|
Loading…
Reference in a new issue