Repository navigation
test(remote): assert a reconnect's three decisions without a child process - #1266
Merged
Merged
Conversation
…ocess `Supervisor::restart_slot` decides one of three things from the pairing book alone: stop a device the book no longer holds, forget one whose credential cannot be upgraded in place, refresh one it can. Each was covered only end to end, through a child Desktop — the most expensive and least stable way to assert a three-way match. - `supervisor/start.rs`: the decision is split out as `recovery_plan(&[PairingCreds], &str) -> SlotRecovery`, a pure function with no broker, no platform and no child; `restart_slot` matches on it, and each arm keeps its own effect (`stop_slot`, `forget_slot`, the refresh round trip). - `supervisor/reconnect_tests.rs`: the three decisions plus the file effect of `Forget` (the slot leaves the book, so a device that can never connect stops being retried on every start). No timing in any of them. This ports the intent of `aeda36823` (which was written against the pre-#1259 tree and could not be cherry-picked: `restart_slot` now lives in `packages/remote-server/`, and its `desktop/`-side file is a 37-line forwarding shell). The other half of that commit — gating the child tests 3 and 4 `macos`-only because their fixture raced the `Remote: Ready` printout — is **deliberately not ported**: main already replaced that dependency, so both tests now poll the broker's connect counter and the book file instead of a status line, and gating them would drop Linux coverage for a race that no longer exists. Verified: `cargo test -p future-remote-server --lib` 164 passed, 5 ignored; `cargo clippy -p future-remote-server --all-targets -- -D warnings` clean; `cargo check -p future-host` clean (the crate's only in-tree consumer of this module); `cargo fmt --all --check` clean.
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.
test(remote): assert a reconnect's three decisions without a child process
Supervisor::restart_slotdecides one of three things from the pairing bookalone: stop a device the book no longer holds, forget one whose credential cannot
be upgraded in place, refresh one it can. Each was covered only end to end,
through a child Desktop — the most expensive and least stable way to assert a
three-way match.
supervisor/start.rs: the decision is split out asrecovery_plan(&[PairingCreds], &str) -> SlotRecovery, a pure function with nobroker, no platform and no child;
restart_slotmatches on it, and each armkeeps its own effect (
stop_slot,forget_slot, the refresh round trip).supervisor/reconnect_tests.rs: the three decisions plus the file effect ofForget(the slot leaves the book, so a device that can never connect stopsbeing retried on every start). No timing in any of them.
This ports the intent of
aeda36823(which was written against the pre-#1259 treeand could not be cherry-picked:
restart_slotnow lives inpackages/remote-server/, and itsdesktop/-side file is a 37-line forwardingshell). The other half of that commit — gating the child tests 3 and 4
macos-only because their fixture raced theRemote: Readyprintout — isdeliberately not ported: main already replaced that dependency, so both tests
now poll the broker's connect counter and the book file instead of a status line,
and gating them would drop Linux coverage for a race that no longer exists.
Verified:
cargo test -p future-remote-server --lib164 passed, 5 ignored;cargo clippy -p future-remote-server --all-targets -- -D warningsclean;cargo check -p future-hostclean (the crate's only in-tree consumer of thismodule);
cargo fmt --all --checkclean.