Skip to content

fix(host): read the control notice instead of counting packets - #1631

Merged
huichen merged 2 commits into
mainfrom
pr/huichen
Nov 16, 2026
Merged

huichen merged 2 commits into
mainfrom
pr/huichen

Conversation

@huichen

@huichen huichen commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

A multi-device end-to-end test read any control packet in a 300 ms window as
"the machine told this device to stand by", so a legitimate announcement of the
device's own arrival — published from a task the handshake spawns after it has
answered, racing the activation of the sealed channel — reported a displacement
that never happened on a loaded runner (CI run 43885835542 on PR #1630). The
helper now opens each packet and counts only a control state that is not
active; a state the test does not know and a packet it cannot open both still
count, so a real stand-by notice keeps failing the assertion.

Commits

  • fix(host): read the control notice instead of counting packets — told_to_stand_by replaces control_pending in the multi_device e2e module; the window, the assertion and its message are unchanged.

Verification

Local, at fabf77a8b on dev-huichen (rustc 1.99.1 pinned, ulimit -n 8192):

  • cargo fmt --all -- --check — clean
  • cargo check -p future-host --all-targets — clean
  • cargo clippy -p future-host --all-targets -- -D warnings — clean
  • cargo test -p future-host --lib — 2269 passed, 0 failed, 15 ignored (447s)
  • real broker (nats-server on a free port, VERIFY_E2E_NATS_URL):
    remote::verify_e2e::multi_device::a_second_device_is_told_who_holds_the_machine_and_only_takes_it_when_asked
    passed 3/3 (0.98s each); remote::verify_e2e::multi_device — 2 passed

User-visible changes

None: test-only change inside host/src/remote/verify_e2e.rs. No product code,
no defaults, no data formats.

The multi-device e2e test asserted "the controller must not be told to
stand by just because a device connected" by counting *any* control packet
in a 300 ms window. The machine also announces a device's own arrival
(`control: active`) on that same channel, from a task the handshake spawns
after it has answered, so that notice races the activation of the sealed
channel: while the seal has no key it is dropped, and once the client's
`secure_ready` activated one it is delivered. On a loaded runner it is
delivered, the `active` lands inside the window, and the assertion reported
a displacement that never happened (CI run 43885835542 on PR #1630).

`told_to_stand_by` now opens each packet and counts only a control state
that is not `active` — and, deliberately, any state this test does not know
and any packet it cannot open — so a real "stand by" notice still fails it
(verified by publishing one at a device's connect) while the device's own
arrival no longer does. The window, the assertion and its message are
unchanged; only what counts as news is.
@huichen
huichen enabled auto-merge (squash) November 16, 2026 15:33
@huichen huichen closed this Nov 16, 2026
auto-merge was automatically disabled November 16, 2026 15:35

Pull request was closed

@huichen huichen reopened this Nov 16, 2026
@huichen
huichen enabled auto-merge (squash) November 16, 2026 15:48
@huichen
huichen merged commit f45797c into main Nov 16, 2026
40 of 42 checks passed
@huichen
huichen deleted the pr/huichen branch November 16, 2026 16:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant