From 7653760a7492791b267fe550508e6a131ae9a1ec Mon Sep 17 00:00:00 2001 From: Marco Munizaga Date: Thu, 23 Feb 2023 14:00:35 -0800 Subject: [PATCH 1/2] identify: Bump timeouts/sleep in tests --- p2p/protocol/identify/id.go | 1 + p2p/protocol/identify/id_test.go | 2 +- p2p/protocol/identify/obsaddr_test.go | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/p2p/protocol/identify/id.go b/p2p/protocol/identify/id.go index 3bbe58bf7d..e8047d0ccb 100644 --- a/p2p/protocol/identify/id.go +++ b/p2p/protocol/identify/id.go @@ -353,6 +353,7 @@ func (ids *idService) IdentifyWait(c network.Conn) <-chan struct{} { e, found := ids.conns[c] if !found { // No entry found. Connection was most likely closed (and removed from this map) recently. + log.Debugf("connection %s not found in identify service", c.RemotePeer()) ch := make(chan struct{}) close(ch) return ch diff --git a/p2p/protocol/identify/id_test.go b/p2p/protocol/identify/id_test.go index 00aeecb189..6dc4b99aea 100644 --- a/p2p/protocol/identify/id_test.go +++ b/p2p/protocol/identify/id_test.go @@ -890,7 +890,7 @@ func TestIncomingIDStreamsTimeout(t *testing.T) { } } return true - }, 1*time.Second, 200*time.Millisecond) + }, 5*time.Second, 200*time.Millisecond) } } diff --git a/p2p/protocol/identify/obsaddr_test.go b/p2p/protocol/identify/obsaddr_test.go index aa347e59eb..e807dd08be 100644 --- a/p2p/protocol/identify/obsaddr_test.go +++ b/p2p/protocol/identify/obsaddr_test.go @@ -71,14 +71,14 @@ func (h *harness) connInbound(observer peer.ID) network.Conn { func (h *harness) observe(observed ma.Multiaddr, observer peer.ID) network.Conn { c := h.conn(observer) h.oas.Record(c, observed) - time.Sleep(50 * time.Millisecond) // let the worker run + time.Sleep(200 * time.Millisecond) // let the worker run return c } func (h *harness) observeInbound(observed ma.Multiaddr, observer peer.ID) network.Conn { c := h.connInbound(observer) h.oas.Record(c, observed) - time.Sleep(50 * time.Millisecond) // let the worker run + time.Sleep(200 * time.Millisecond) // let the worker run return c } From f71aa4c56f61d9527772d3c54adeb0b00a255e39 Mon Sep 17 00:00:00 2001 From: Marco Munizaga Date: Thu, 23 Feb 2023 14:54:54 -0800 Subject: [PATCH 2/2] Update p2p/protocol/identify/id.go Co-authored-by: Marten Seemann --- p2p/protocol/identify/id.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/p2p/protocol/identify/id.go b/p2p/protocol/identify/id.go index e8047d0ccb..9df5b32dfc 100644 --- a/p2p/protocol/identify/id.go +++ b/p2p/protocol/identify/id.go @@ -353,7 +353,7 @@ func (ids *idService) IdentifyWait(c network.Conn) <-chan struct{} { e, found := ids.conns[c] if !found { // No entry found. Connection was most likely closed (and removed from this map) recently. - log.Debugf("connection %s not found in identify service", c.RemotePeer()) + log.Debugw("connection not found in identify service", "peer", c.RemotePeer()) ch := make(chan struct{}) close(ch) return ch