Skip to content

Commit

Permalink
tests: fix a race in TestP2PwsStreamHandlerDedup
Browse files Browse the repository at this point in the history
  • Loading branch information
algorandskiy committed Aug 28, 2024
1 parent e14fea6 commit c559b8c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions network/p2pNetwork_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1187,8 +1187,10 @@ func TestP2PwsStreamHandlerDedup(t *testing.T) {
return networkPeerIdentityDisconnect.GetUint64Value() == networkPeerIdentityDisconnectInitial+1
}, 2*time.Second, 50*time.Millisecond)

require.False(t, netA.hasPeers())
require.False(t, netB.hasPeers())
// now allow the peer made outgoing connection to handle conn closing initiated by the other side
require.Eventually(t, func() bool {
return !netA.hasPeers() && !netB.hasPeers()
}, 2*time.Second, 50*time.Millisecond)
}

// TestP2PEnableGossipService_NodeDisable ensures that a node with EnableGossipService=false
Expand Down

0 comments on commit c559b8c

Please sign in to comment.