You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
test(iroh): Make endpoint_relay_connect_loop not flaky (#3402)
## Description
`endpoint_relay_connect_loop` was flaky before. This *should* fix this
issue. It was last marked flaky (but for windows only) in #3354.
What seems to have happened:
- The test spawns a relay server
- The test spawns a server iroh Endpoint
- The server Endpoint does a net report with QAD probes
- For some reason the spawned relay server is very slow in responding to
QAD requests (>3s)
- The QAD probes time out, the server Endpoint ends up without a home
relay
- The test spawns a client iroh Endpoint
- The client Endpoint tries to connect for 30s
- The server Endpoint doesn't do another net report for 30s, though, so
never ends up being reachable
- The client Endpoint times out.
To work around this, I'm starting the server endpoint and waiting for it
to have a relay address.
IMO this is reasonable to do in tests.
I've also made the tests use `Connection::close` and
`Connection::closed` properly and removed `SendStream::stopped` and
`RecvStream::read_to_end(0)` calls.
## Notes
There's some other drive-by changes. Sorry about that, but IMO they're
kinda too small for their own PRs:
- `net_report` thought that `Watchable::set` would return `Err` when
there's no more watchers listening, but that's incorrect: It returns
`Err` from `set` when the value set is the same as the currently stored
value.
- I've also made some small cosmetic changes to `net_report`
- I've removed a 1600 bytes allocation from the hot path of receiving
relay items in `ActiveRelayActor`.
## Change checklist
<!-- Remove any that are not relevant. -->
- [x] Self-review.
// if we've sent to an ipv4 address, but received an observed address
710
-
// that is ivp6 then the address is an [IPv4-Mapped IPv6 Addresses](https://doc.rust-lang.org/beta/std/net/struct.Ipv6Addr.html#ipv4-mapped-ipv6-addresses)
711
-
let val = val.map(|val| SocketAddr::new(val.ip().to_canonical(), val.port()));
// if we've sent to an ipv4 address, but received an observed address
711
+
// that is ivp6 then the address is an [IPv4-Mapped IPv6 Addresses](https://doc.rust-lang.org/beta/std/net/struct.Ipv6Addr.html#ipv4-mapped-ipv6-addresses)
712
+
let val = val.map(|val| SocketAddr::new(val.ip().to_canonical(), val.port()));
// if we've sent to an ipv4 address, but received an observed address
778
+
// that is ivp6 then the address is an [IPv4-Mapped IPv6 Addresses](https://doc.rust-lang.org/beta/std/net/struct.Ipv6Addr.html#ipv4-mapped-ipv6-addresses)
779
+
let val = val.map(|val| SocketAddr::new(val.ip().to_canonical(), val.port()));
0 commit comments