Merge pull request #1461 from libp2p/fix-flaky-quic-rcmgr-accept-test
quic: fix flaky TestResourceManagerAcceptDenied
This commit is contained in:
commit
7bfde91b34
|
@ -198,9 +198,13 @@ func TestResourceManagerAcceptDenied(t *testing.T) {
|
|||
clientRcmgr.EXPECT().OpenConnection(network.DirOutbound, false).Return(clientConnScope, nil)
|
||||
clientConnScope.EXPECT().SetPeer(serverID)
|
||||
conn, err := clientTransport.Dial(context.Background(), ln.Multiaddr(), serverID)
|
||||
require.NoError(t, err)
|
||||
_, err = conn.AcceptStream()
|
||||
require.Error(t, err)
|
||||
// In rare instances, the connection gating error will already occur on Dial.
|
||||
if err != nil {
|
||||
clientConnScope.EXPECT().Done()
|
||||
} else {
|
||||
_, err = conn.AcceptStream()
|
||||
require.Error(t, err)
|
||||
}
|
||||
select {
|
||||
case <-connChan:
|
||||
t.Fatal("didn't expect to accept a connection")
|
||||
|
|
Loading…
Reference in New Issue