From 68c682ea913b4e83c98861b8f80bcfc618bd5529 Mon Sep 17 00:00:00 2001 From: Marco Munizaga Date: Thu, 16 Jan 2025 15:19:15 -0500 Subject: [PATCH] small nits --- p2p/discovery/mdns/mdns.go | 7 ++++--- p2p/discovery/mdns/mdns_test.go | 8 ++++---- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/p2p/discovery/mdns/mdns.go b/p2p/discovery/mdns/mdns.go index 646b7f1f0b..82b5e5f946 100644 --- a/p2p/discovery/mdns/mdns.go +++ b/p2p/discovery/mdns/mdns.go @@ -3,14 +3,15 @@ package mdns import ( "context" "errors" - "github.com/libp2p/go-libp2p/core/event" - "github.com/libp2p/go-libp2p/core/host" - "github.com/libp2p/go-libp2p/core/peer" "io" "math/rand" "strings" "sync" + "github.com/libp2p/go-libp2p/core/event" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p/core/peer" + "github.com/libp2p/zeroconf/v2" logging "github.com/ipfs/go-log/v2" diff --git a/p2p/discovery/mdns/mdns_test.go b/p2p/discovery/mdns/mdns_test.go index 270788dd64..662dba6de3 100644 --- a/p2p/discovery/mdns/mdns_test.go +++ b/p2p/discovery/mdns/mdns_test.go @@ -1,12 +1,13 @@ package mdns import ( - "github.com/libp2p/go-libp2p/core/event" - "github.com/libp2p/go-libp2p/core/host" "sync" "testing" "time" + "github.com/libp2p/go-libp2p/core/event" + "github.com/libp2p/go-libp2p/core/host" + "github.com/libp2p/go-libp2p" "github.com/libp2p/go-libp2p/core/peer" @@ -114,7 +115,6 @@ func setupHost(t *testing.T) (host.Host, *notif) { } func TestMdnsServiceIpChange(t *testing.T) { - host1, notif1 := setupHost(t) defer host1.Close() @@ -131,5 +131,5 @@ func TestMdnsServiceIpChange(t *testing.T) { assert.Eventually(t, func() bool { return len(notif1.GetPeers()) == 1 && len(notif2.GetPeers()) == 1 - }, 5*time.Second, 5*time.Millisecond) + }, 5*time.Second, 100*time.Millisecond) }