Repository navigation
fix(test): make watcher close and relay path prerequisites explicit - #25
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Three path tests depend on uncontrolled timing: the peer-close watcher races real socket delivery against a paused clock, and two relay-policy tests expect the default RTT selector to choose direct traffic on loopback. This PR makes those prerequisites explicit while retaining every policy assertion. It does not change production selection or timeouts.
The server watcher assertion can time out before a CONNECTION_CLOSE packet arrives over a real socket. Tokio time is paused at that point. Its automatic clock advance races the packet against a one-nanosecond deadline.
Wait up to one real second for
conn_server.closed()and checkApplicationClosed. Then pause time again and keep the one-nanosecond watcher assertion. The client watcher assertion stays in place. No sleeps, retries, production changes, or setup deadline changes.Linux x86_64 results (gt2, Rust 1.100.0, GCC/BFD, dev debug information disabled):
All five reproduced failures were the server watcher timeout at
connection.rs:1660, matching Ubuntu CI job 136432133137. The failed rounds were 20, 24, 30, 36, and 42. Both versions used CPU 0, two Python busy loops on CPU 0, and the exact test filter with--nocapture.The diagnostic used
std::time::Instantfrom client close to server watcher completion. Each revision ran 50 times.These samples show no server shutdown slowdown in the newer revision.
Validation limitations remain visible:
cargo test --locked -p iroh --lib endpoint::connectionfails to compile an existing test inremote_state.rs. It importstest_transportand callsadd_custom_transportwithout the required feature gate.cargo test --locked -p iroh --lib endpoint::connection --features test-utils,unstable-custom-transportspasses all four tests. All repeated experiments used those features.connection.rshas the same paused-clock, one-nanosecond pattern.Two relay-policy test builders now use
relay_last(). The default selector can retain an already selected relay when direct RTT improves by less thanmax(5 ms, current RTT / 4). A captured failure ended with IP 1.562 ms versus selected relay 2.586 ms, so the original 20-second selected-direct prerequisite never completed.The tests still require both relay backup paths, disabled-path retirement, zero sends through the disabled relay, increasing keepalive counters through the other relay, connection/direct-path survival, and relay use after re-enabling it. No assertion or deadline changed.
Matched Linux CPU-contention comparison (CPU 0, two busy processes on CPU 0, original/fixed interleaved, 50 executions of each test/version):
remote_relays_narrowed_send_nothing_through_the_one_left_outdisabled_relays_hold_a_connection_keptAll 26 original failures occurred at the selected-direct prerequisite, before relay-policy assertions. Five sequential batches used the same binary hashes and conditions; no failed fixed run was discarded or retried. The earlier revision diagnostic ran each test three times: old revision both 3/3 passed; current narrowed 2/3 and kept 3/3. RTT sampling and initial selection timing differed, but this does not isolate the noq pin change as the cause. The default selector source is identical in both revisions.
Scope: monoid products install their own
mesh_transport::selection::Selector. Its thresholds are separate; this PR changes only iroh tests. Ubuntu and macOS CI on the updated head remain to be checked.Base:
stillfailat0e1ba28b1d436e6b367f14a6ba146d1fed56c3f1. Please leave this PR unmerged for maintainer review and Ubuntu/macOS CI.Model: OpenAI Codex. Tests: Rust libtest and Tokio, with a Python repetition harness.