tests: add comprehensive end-to-end tests for connection gating#2200
tests: add comprehensive end-to-end tests for connection gating#2200marten-seemann merged 3 commits intomasterfrom
Conversation
d4872ec to
03a37d3
Compare
ab67003 to
eccdae1
Compare
|
What is needed to land this? Review from @MarcoPolo ? I'm asking because this is one of the blockers for #1999 right? |
1 similar comment
|
What is needed to land this? Review from @MarcoPolo ? I'm asking because this is one of the blockers for #1999 right? |
p2p/test/transport/gating_test.go
Outdated
| require.Equal(t, stripCertHash(h2.Addrs()[0]).String(), addrs.RemoteMultiaddr().String()) | ||
| }), | ||
| ) | ||
| require.Error(t, h1.Connect(ctx, peer.AddrInfo{ID: h2.ID(), Addrs: h2.Addrs()})) |
There was a problem hiding this comment.
What error are we expecting?
There was a problem hiding this comment.
Depends on the transport. All we can assert here is that some kind of error occurred.
There was a problem hiding this comment.
Can we do better? Should we return a well known error? Callers may want to check if this error case happened and it doesn’t make sense for them to check against all error types depending on underlying transport.
There was a problem hiding this comment.
Probably, but that would require changing all the transports.
p2p/test/transport/gating_test.go
Outdated
| require.Error(t, h1.Connect(ctx, peer.AddrInfo{ID: h2.ID(), Addrs: h2.Addrs()})) | ||
| // There's a bug in the WebSocket library, making Close block for up to 5s. | ||
| // See https://github.com/nhooyr/websocket/issues/355 for details. | ||
| if _, err := h2.Addrs()[0].ValueForProtocol(ma.P_WS); err == nil { |
There was a problem hiding this comment.
Same comments as above here.
Was reviewing as you wrote that! |
eccdae1 to
7bb03ef
Compare
7bb03ef to
1e2f471
Compare
f30bd71 to
e03d8fa
Compare
e03d8fa to
4c3a890
Compare
4c3a890 to
e4c09d4
Compare
No description provided.