tests(iroh-net): Make derp connect loop test more reliable #2064
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This refactors this test which has had reports of being flaky a bit.
It tiedies up some logging but most significantly:
The server task is now aborted properly regardless of how the test
execution works out.
The clients are no longer moved to a task. The server is
handling them sequentially anyway so there's not much to gain from
having one of the clients sit around waiting to be accepted.
Most importantly, and possibly the relevant bugfix, both clients
were using the same NodeId. This may just about work out if both
are not connecting at the same time as it would maybe look like a
migrating client to the server. But combined with the clients
before being spawned in tasks this would have confused the server's
PathState quite a lot. I don't believe these clients should have
shared their NodeId.
A (generous) timeout is added to the test. The flake issue mentions
that this is sometimes just very slow. There really is no reason
for this to be slow so consider these failures so that we get
debugging info from them in the form of logs.
Notes & open questions
Closes #2050
At least, it might. I guess we'll reopen it if it doesn't.
Change checklist