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

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

Merged
merged 3 commits into from
May 11, 2023

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
Contributor

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
Contributor

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.

p2p/test/transport/gating_test.go Outdated Show resolved Hide resolved
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
Contributor

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
Contributor

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 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
19 checks passed
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.

None yet

3 participants