Repository navigation
test(relay): two pass contract tests wait for the pass they read the status of - #3568
Conversation
…status of Both read `pass` in the relay status before the PC's pass had necessarily arrived, so they failed or passed by timing. - "with passes off on the relay, ..." failed a local merge gate under load (`state` `unavailable` instead of `ok`). A relay with passes off lets the PC in without its pass, so whether its sync or the pass came first was timing, and the test read the status right after the sync. The account service's answer is now held until the sync (a `signing` hook in the fixture), so the pass always comes second and goes out on the open control socket; the test waits for that frame, as its neighbours do. - "... one that allows them again clears it" waited on the fixture's one-shot `renewal`, which a second pass asked for at startup could settle first: an enforcing relay may refuse the PC's first control socket before its pass comes, and the PC then asks twice. The PC now starts on a saved pass (`savePass`), so the only renewal is the test's own. No sleep, no polling, no production code. Co-Authored-By: Claude Fable 5.2 <[email protected]>
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
Local merge gate: PASS
The Linux suites of the required checks (Fast checks, Integration and browser), run on main 584d4cc with this PR's head 5aa034b merged in (local merge 57bc6293654f, not pushed), as groups side by side in the self-hosted CI runner image on
Reruns:
Total 951s. |
Merge passMerged head
One reviewer: owner's test-only PR: one contract test file. Test-only (server/relay/pass.contract.test.ts): one reviewer (Codex Terra), CLEAR with no findings. Fixes the flake that failed an unrelated local merge gate. |
What
Test only:
server/relay/pass.contract.test.ts. Two tests readpassin the relay status before the PC's pass had necessarily arrived, so they passed or failed by timing. No production code, no sleep, no polling.pass.statewasunavailableinstead ofok, in 31 ms (not a timeout). A relay with passes off lets the PC in without its pass, so whether the relay'ssyncor the pass came first was a matter of timing, and the test read the status right after thesync. The account service's answer is now held until thesync(asigninghook in the fixture), so the pass always comes second and goes out on the open control socket; the test waits for that frame (f.renewal), as its neighbours do.renewal. The PC now starts on a saved pass (f.savePass()), so it asks for none at startup and the only renewal is the test's own. Thepass_versionscheck moved after that renewal, which is now the first request the PC makes.Validation
syncand the status read where it used to be: 20 of 20 runs fail with the gate's diff (stateunavailable, expectedok);sync): a renewal went out at startup in 3 of 3 runs, and with the renewal's own pass left unanswered the test failed at once in 5 of 5 (new_sessions: falsestill there), so its wait had returned without its pass.bun test server/relay/pass.contract.test.ts -t "with passes off on the relay|one that allows them again clears it"): 200 runs one after another on 4 CPUs kept busy by 16 spinning processes: 200 pass, 0 fail. 240 runs as 24 copies at once on the same 4 CPUs: 240 pass, 0 fail. The load was pinned to 4 CPUs, not all cores, to leave the other lanes and the gate alone.bun test server/relay/pass.contract.test.tsat the pushed head: 20 pass, 0 fail.bun run check fastat the pushed head (5aa034b, on main 14b5e8c): all ok (unit 14496 pass, 0 fail, 50 skip in 878 files). The loops ran on the same test file one main commit earlier (f885760); fix(relay): leftovers of the add window: a close also stops an approved comparison, and the expiry timer is capped #3553 does not touch it.check full, browser regressions, Windows and macOS. No changelog fragment: nothing a user notices.🤖 Generated with Claude Code