Repository navigation
test(relay): tests prove a session stayed open by its end, not a quiet window #8087
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
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
755f2e7
chore(quest): claim quest/m1/mock-clock-tests/rs-relay.md
kixelated 8a165d3
test(relay): auth and revalidate tests prove a session stayed open by…
kixelated 9fc89a6
test(relay): tenant and socket listings prove absence once synced
kixelated 746df88
test(relay): the GOAWAY handover deadline runs on a manual clock
kixelated d5a480a
quest: narrow rs-relay to the mesh tests that remain
kixelated d12cf09
style: rustfmt
kixelated 275f24a
Merge origin/main
kixelated bd2f12f
quest: record the dial-hook decision for the relay's mesh tests
kixelated 4a946b5
Merge origin/main
kixelated File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,21 +1,55 @@ | ||
| # [M] moq-relay tests run on a mocked clock | ||
| # [M] moq-relay's mesh tests run on a mocked clock | ||
|
|
||
| ## Goal | ||
|
|
||
| moq-relay's tests stop proving a session stayed open with | ||
| `timeout(200ms, session.closed()).is_err()` on the real clock, and stop | ||
| sleeping to settle. See the [epic](/quest/m1/mock-clock-tests/README.md) | ||
| for the rules. | ||
| moq-relay's multi-relay and process-signal tests stop proving that nothing | ||
| happened by waiting out a quiet window, and stop sleeping to settle. See the | ||
| [epic](/quest/m1/mock-clock-tests/README.md) for the rules. | ||
|
|
||
| ## Plan | ||
|
|
||
| As of 2026-11-06, 28 tests: `tests/integration/auth_lifetime.rs` 9, | ||
| `session_revalidate.rs` 4, `public_rules.rs` 3, `goaway_cluster.rs` 2, | ||
| `runtime_uring.rs` 2, `tenant_matrix.rs` 2, `web.rs` 2, and one each in | ||
| `cluster_unknown.rs`, `socket_auth.rs`, `src/auth.rs`, and `src/session.rs`. | ||
| Many run over real sockets: assert on the event the relay emits (a | ||
| revalidation, a close reason), or drive the deadline with the | ||
| [simulator or a `Manual` clock](/quest/m0/test-flakes-2/README.md), rather | ||
| than waiting out a window. | ||
| The single-relay tests are done: a session that stays open is proven by the | ||
| `end` its lease reports for the client's own close, an absent broadcast by a | ||
| listing read to `Synced`, and the GOAWAY handover by a manual clock. What is | ||
| left, as of 2026-11-06: | ||
|
|
||
| Public API: none. Wire: none. | ||
| - `cluster_unknown.rs`: `assert_unknown_publisher_stays_announced` watches for | ||
| a flap for `SETTLE` (1s) after the frame reaches D. | ||
| - `goaway_cluster.rs`: `cluster_migrates_on_upstream_goaway` and | ||
| `cluster_continues_a_group_split_by_goaway` end on a 500ms window with no | ||
| retraction, and the second also on a 500ms window with no downstream GOAWAY. | ||
| - `cluster_drain.rs`: `pass` moves a manual clock in steps and sleeps `SETTLE` | ||
| on tokio's clock after each, so real sockets catch up. | ||
| - `shutdown_signal.rs`: `an_embedder_owns_the_signals` waits `DRAIN_TIMEOUT / 2` | ||
| for a GOAWAY that must not come. | ||
|
|
||
| Each crosses a mesh of relays over loopback, where no event marks convergence: | ||
| `Synced` is per hop, origin cursors coalesce across prefixes, and retractions | ||
| are held for `update_hold`. A quiet window is the only proof that fits today. | ||
| Only the simulator's `idle` proves a mesh has settled, and the cluster dials | ||
| peers only through `moq_tokio` sockets. | ||
|
|
||
| Tests that only wait for progress, or bound real-socket timing from below, stay | ||
| on the real clock: the `runtime_uring.rs` and listing poll loops, `web.rs`'s | ||
| `start.elapsed() >= timeout`, `bitrate_caps.rs`'s `LEAST`, and | ||
| `shutdown_signal.rs`'s drain-window lower bounds. | ||
|
|
||
| Decided 2026-11-06 (maintainer, on | ||
| [moq-dev/moq#8087](https://github.com/moq-dev/moq/pull/8087)): | ||
|
|
||
| - ✅ **A dial hook on `cluster::Options` that an in-memory link can fill**, so | ||
| the four tests above run on `kio::clock::sim` and prove convergence with | ||
| `sim::idle` instead of a quiet window. Not chosen: keeping them as documented | ||
| real-clock exceptions opted out of the [Rust guard](/quest/m0/clock-guard/rust.md). | ||
|
|
||
| Guidance: | ||
|
|
||
| - The hook is public API whose only consumer today is these tests; name it by | ||
| role (how a peer is reached), not by the test transport. | ||
| - The mesh tests build whole relays with `Relay::load` over loopback, so the | ||
| simulator needs a relay that accepts in-memory links too, as | ||
| `tests/integration/memory.rs` already does for one relay. | ||
| - `shutdown_signal`'s window waits on a process signal, not a mesh: its relay | ||
| must also take that signal from a source the simulator can drive. | ||
|
|
||
| Public API: a new `cluster::Options` dial hook. Wire: none. | ||
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
four testsdoes not match the bullets above:goaway_cluster.rsnames two, so five tests across four files are listed. Saythe tests above(orthe four files above) so whoever converts them is not short by one.