Skip to content
This repository has been archived by the owner on May 11, 2022. It is now read-only.

fix flaky tests #120

Merged
merged 1 commit into from
Dec 22, 2021
Merged

fix flaky tests #120

merged 1 commit into from
Dec 22, 2021

Conversation

marten-seemann
Copy link
Contributor

@marten-seemann marten-seemann commented Dec 21, 2021

Depends on #119.

The problem here was that the test stream handler would write the autonat response right away, and then close the stream (which send a FIN for the write side and resets the read side of the stream).
This would then trip up the peer when it tries to write the message:

req := newDialMessage(peer.AddrInfo{ID: c.h.ID(), Addrs: c.addrFunc()})
if err := w.WriteMsg(req); err != nil {
s.Reset()
return nil, err
}

The fix is easy: read the client's message first, only then send the response.

@marten-seemann
Copy link
Contributor Author

Just that this fix apparently doesn't work. Debugging...

@marten-seemann marten-seemann marked this pull request as draft December 21, 2021 13:13
@marten-seemann
Copy link
Contributor Author

The reason for the failure was: #119 (comment).

@marten-seemann marten-seemann marked this pull request as ready for review December 21, 2021 14:33
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant