Skip to content

Commit

Permalink
holepunch: disable the resource manager in tests (#1897)
Browse files Browse the repository at this point in the history
  • Loading branch information
marten-seemann authored Nov 22, 2022
1 parent 14ca991 commit 23bef30
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion p2p/protocol/holepunch/holepunch_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,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)

Expand All @@ -443,7 +444,11 @@ func makeRelayedHosts(t *testing.T, h1opt, h2opt []holepunch.Option, addHolePunc
t.Helper()
h1, _ = mkHostWithHolePunchSvc(t, h1opt...)
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)
Expand Down Expand Up @@ -483,6 +488,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...)
Expand Down

0 comments on commit 23bef30

Please sign in to comment.