Repository navigation
test(secret-input): keep the dropped link down until the test restores it - #4941
Conversation
…s it The offline password check relied on Chromium's offline emulation alone to stop the page's loopback reconnect; under CI load a reconnect got through before the typing, so the secret was sent and no refusal banner showed. The test's WebSocket wrapper now dials a closed port until the test restores it.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 6 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
Merged through Test-only fix for main's red ui-contexts-regression flake (secret-input-regression.ts:237). Reviews: omo gate CLEAR at a5a764f (dori review); CodeRabbit skipped this head. Verified in herdr-ci-runner:local: fixed 10/10; forced race original 2/2 fail, fixed 3/3 pass. Merged by lane main-red-secret-input on the brief's word. |
Why
main went red on 20fc6e7 (run 46102938431):
ui-contexts-regressionfailed once atscripts/secret-input-regression.ts:237(the offline password refusal banner never showed) and passed on retry, which the lane counts as a failure.Not a #4918 mismatch: the script already expects the desktop grid to take the password. The failing attempt's client connection trace shows the race: after the test calls
setOffline(true)and closes the page's sockets, the page reconnected 250 ms later and answered a probe. The server is on this device, so the client rightly ignoresnavigator.onLine(deviceLocal), and the only thing keeping the link down was Chromium's offline emulation, which let that loopback reconnect through. Under CI load the click and typing came after the reconnect, sooffline-secretwent over a live link and no banner was shown.Change
Test only. The test's WebSocket wrapper now keeps the link down until the test restores it: once dropped, a reconnect dials
ws://127.0.0.1:9/(nothing listens), and the test restores it beforesetOffline(false). No product code changes.Verification (runner image herdr-ci-runner:local)
setOffline(true)so nothing but the test blocks the reconnect, and wait 1.5 s after the drop before typing. Original script: 2/2 fail at line 237 with the same TimeoutError as CI. Fixed script: 3/3 pass, and the refusal banner is on screen when the secret is typed.setOfflineand the 1.5 s delay, fixed: 3/3 pass.bun run typecheckandbun test scripts/conventions.test.tspass.