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

fix flaky BasicHost tests #1202

Merged
merged 1 commit into from
Sep 26, 2021
Merged

Conversation

marten-seemann
Copy link
Contributor

Fixes #1094.

The problem here is that we're dialing a TCP and QUIC connection simultaneously. Occasionally, the timing works out such that the dial limiter kills the QUIC connection right after it has been dialed: https://github.com/libp2p/go-libp2p-swarm/blob/88ef86a16cf0bbc451c3799f63278d345aaf56ea/limiter.go#L228-L234.
From the other host's side (acting as the the QUIC server), this connection looks like a fully functioning connection, and it will happily open a stream on this connection, just to learn a moment later that the connection is getting closed, resulting in the errors we're seeing.

The fix is to have the host that dialed the connect (i.e. the QUIC client) open the stream. This PR therefore swaps the roles of stream initiator / receiver in most tests.

@marten-seemann marten-seemann merged commit bd2214a into master Sep 26, 2021
@marten-seemann marten-seemann deleted the fix-basic-host-test-failures branch September 26, 2021 15:13
@aschmahmann aschmahmann mentioned this pull request Dec 1, 2021
80 tasks
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.

TestProtoDowngrade is flaky
2 participants