Skip to content

Commit c7e286e

Browse files
authored
fix: limit interfaces in test (#5567)
1 parent 9c4add7 commit c7e286e

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

pkg/p2p/libp2p/libp2p_test.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,11 @@ func newService(t *testing.T, networkID uint64, o libp2pServiceOpts) (s *libp2p.
5555
t.Fatal(err)
5656
}
5757

58-
addr := ":0"
58+
// Bind loopback only so host.Addrs() stays small and independent of the
59+
// machine's docker/bridge NICs. Handshake truncates underlays to
60+
// maxUnderlaysPerPeer; listening on :0 expands to every local interface
61+
// and breaks addressbook equality checks on hosts with many addresses.
62+
addr := "127.0.0.1:0"
5963

6064
if o.Logger == nil {
6165
o.Logger = log.Noop

0 commit comments

Comments
 (0)