fix connection gater integration test

This commit is contained in:
Marten Seemann 2023-03-15 18:10:29 +13:00
parent 92dd629f42
commit 21b74deab4

View File

@ -182,8 +182,14 @@ func TestNetBlockPeer(t *testing.T) {
t.Errorf("blocked peer not in blocked peer list")
}
require.Error(t, secondNode.NetConnect(ctx, firstAddrInfo), "shouldn't be able to connect to second node")
connectedness, err = secondNode.NetConnectedness(ctx, firstAddrInfo.ID)
err = secondNode.NetConnect(ctx, firstAddrInfo)
// With early muxer selection, we'll only learn that the handshake failed
// when we do something with the connection, for example when we open a stream.
if err == nil {
_, err = secondNode.NetPing(context.Background(), firstAddrInfo.ID)
}
require.Error(t, err, "shouldn't be able to connect to second node")
connectedness, err = firstNode.NetConnectedness(ctx, secondNodeID)
require.NoError(t, err, "failed to determine connectedness")
require.NotEqual(t, connectedness, network.Connected)