Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

identify: Bump timeouts/sleep in tests #2135

Merged
merged 2 commits into from
Feb 24, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions p2p/protocol/identify/id.go
Original file line number Diff line number Diff line change
Expand Up @@ -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())
MarcoPolo marked this conversation as resolved.
Show resolved Hide resolved
ch := make(chan struct{})
close(ch)
return ch
Expand Down
2 changes: 1 addition & 1 deletion p2p/protocol/identify/id_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ func TestIncomingIDStreamsTimeout(t *testing.T) {
}
}
return true
}, 1*time.Second, 200*time.Millisecond)
}, 5*time.Second, 200*time.Millisecond)
}
}

Expand Down
4 changes: 2 additions & 2 deletions p2p/protocol/identify/obsaddr_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down