itests: Deflake TestNetBlockIPAddr
This commit is contained in:
parent
b412d8c179
commit
825564a994
@ -5,6 +5,7 @@ import (
|
|||||||
"context"
|
"context"
|
||||||
"fmt"
|
"fmt"
|
||||||
"testing"
|
"testing"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/libp2p/go-libp2p/core/network"
|
"github.com/libp2p/go-libp2p/core/network"
|
||||||
"github.com/libp2p/go-libp2p/core/peer"
|
"github.com/libp2p/go-libp2p/core/peer"
|
||||||
@ -263,9 +264,12 @@ func TestNetBlockIPAddr(t *testing.T) {
|
|||||||
|
|
||||||
// a QUIC connection might still succeed when gated, but will be killed right after the handshake
|
// a QUIC connection might still succeed when gated, but will be killed right after the handshake
|
||||||
_ = secondNode.NetConnect(ctx, firstAddrInfo)
|
_ = secondNode.NetConnect(ctx, firstAddrInfo)
|
||||||
connectedness, err = secondNode.NetConnectedness(ctx, firstAddrInfo.ID)
|
|
||||||
require.NoError(t, err, "failed to determine connectedness")
|
require.Eventually(t, func() bool {
|
||||||
require.NotEqual(t, connectedness, network.Connected)
|
connectedness, err = secondNode.NetConnectedness(ctx, firstAddrInfo.ID)
|
||||||
|
require.NoError(t, err, "failed to determine connectedness")
|
||||||
|
return connectedness != network.Connected
|
||||||
|
}, time.Second*5, time.Millisecond*10)
|
||||||
|
|
||||||
// stm: @NETWORK_COMMON_BLOCK_REMOVE_001
|
// stm: @NETWORK_COMMON_BLOCK_REMOVE_001
|
||||||
err = firstNode.NetBlockRemove(ctx, api.NetBlockList{IPAddrs: secondNodeIPs})
|
err = firstNode.NetBlockRemove(ctx, api.NetBlockList{IPAddrs: secondNodeIPs})
|
||||||
|
Loading…
Reference in New Issue
Block a user