Skip to content

tests: add comprehensive end-to-end tests for connection gating#2200

Merged
marten-seemann merged 3 commits intomasterfrom
gating-tests
May 11, 2023
Merged

tests: add comprehensive end-to-end tests for connection gating#2200
marten-seemann merged 3 commits intomasterfrom
gating-tests

Conversation

@marten-seemann
Copy link
Contributor

@marten-seemann marten-seemann commented Mar 17, 2023

No description provided.

@marten-seemann marten-seemann mentioned this pull request Mar 17, 2023
17 tasks
@marten-seemann marten-seemann force-pushed the gating-tests branch 2 times, most recently from d4872ec to 03a37d3 Compare March 17, 2023 03:36
@marten-seemann marten-seemann force-pushed the gating-tests branch 3 times, most recently from ab67003 to eccdae1 Compare April 5, 2023 04:44
@BigLep
Copy link
Contributor

BigLep commented Apr 10, 2023

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
@BigLep
Copy link
Contributor

BigLep commented Apr 10, 2023

What is needed to land this? Review from @MarcoPolo ? I'm asking because this is one of the blockers for #1999 right?

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()}))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What error are we expecting?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Depends on the transport. All we can assert here is that some kind of error occurred.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably, but that would require changing all the transports.

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 {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comments as above here.

@MarcoPolo
Copy link
Collaborator

What is needed to land this? Review from @MarcoPolo ? I'm asking because this is one of the blockers for #1999 right?

Was reviewing as you wrote that!

@marten-seemann marten-seemann requested a review from MarcoPolo May 2, 2023 15:06
@marten-seemann marten-seemann changed the base branch from master to websocket-gorilla May 9, 2023 09:19
@marten-seemann marten-seemann changed the base branch from websocket-gorilla to master May 11, 2023 05:00
@marten-seemann marten-seemann merged commit 8a3fafd into master May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants