From f8c0b179dbda34c34a0f6b8d6457a32b3a4fecac Mon Sep 17 00:00:00 2001 From: Marten Seemann Date: Thu, 17 Nov 2022 18:18:31 +1300 Subject: [PATCH] holepunch: disable the resource manager in tests --- p2p/protocol/holepunch/holepunch_test.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/p2p/protocol/holepunch/holepunch_test.go b/p2p/protocol/holepunch/holepunch_test.go index 5676935108..bae330f3d2 100644 --- a/p2p/protocol/holepunch/holepunch_test.go +++ b/p2p/protocol/holepunch/holepunch_test.go @@ -364,6 +364,7 @@ func mkHostWithStaticAutoRelay(t *testing.T, relay host.Host) host.Host { autorelay.WithStaticRelays([]peer.AddrInfo{pi}), ), libp2p.ForceReachabilityPrivate(), + libp2p.ResourceManager(&network.NullResourceManager{}), ) require.NoError(t, err) @@ -387,7 +388,11 @@ func makeRelayedHosts(t *testing.T, h1opt, h2opt holepunch.Option, addHolePunche } h1, _ = mkHostWithHolePunchSvc(t, h1opts...) var err error - relay, err = libp2p.New(libp2p.ListenAddrs(ma.StringCast("/ip4/127.0.0.1/tcp/0")), libp2p.DisableRelay()) + relay, err = libp2p.New( + libp2p.ListenAddrs(ma.StringCast("/ip4/127.0.0.1/tcp/0")), + libp2p.DisableRelay(), + libp2p.ResourceManager(&network.NullResourceManager{}), + ) require.NoError(t, err) _, err = relayv1.NewRelay(relay) @@ -431,6 +436,7 @@ func mkHostWithHolePunchSvc(t *testing.T, opts ...holepunch.Option) (host.Host, h, err := libp2p.New( libp2p.ListenAddrs(ma.StringCast("/ip4/127.0.0.1/tcp/0"), ma.StringCast("/ip6/::1/tcp/0")), libp2p.ForceReachabilityPrivate(), + libp2p.ResourceManager(&network.NullResourceManager{}), ) require.NoError(t, err) hps, err := holepunch.NewService(h, newMockIDService(t, h), opts...)