Repository navigation
test(scripts): settle four flaky browser checks on what they test - #2632
Conversation
- chat-local-send-follow: a wheel notch away from the end is measured as the distance from the end. LegendList keeps the reader's rows in place as rows above the view are measured, which can undo a notch's move in scrollTop (traced: scrollBy(+103) with scrollHeight +103, the distance from the end unchanged). - file-viewer: transcript links right after a reload, a goto or a panel closing are activated where they are, as the script's own header asks; the framed page's table-of-contents click is dispatched to its link. - files-prompt: the Escape after a pane switch stays, and its failure now writes what decided it (keydown probe, focus, modal stack, FilesDialog's stand-down state) to the log and evidence (#2631). - relay-media: Copy link is clicked on the button, not at where a forced click aims.
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
|
Test-only fix for four browser scripts that rotated failures across main's CI runs (lane browser-flakes; no product code). Merge-pass read of the whole diff:
Each script ran 20+ times in a row under load on the lane's side; omo approved (LOW only). A test-only change gets no CodeRabbit round; it merges on its checks. |
Change
Four browser scripts failed now and then in "Browser regression (other scripts)" on main (run 41558343287 on c0cdc8e, and later runs). The take-over failure was a product race, fixed in #2630. This PR fixes the other three, plus the relay-media failure seen on bef2be1. Test-only: no product code changes.
chat-local-send-follow-demo-regression.ts:95: "the reader moves away"wheelUpwaited for each wheel notch to lowerscrollTopby more than 20 px. A write trace on the page showed every notch moving the view 120 px. Then, as a row above the view was measured, LegendList'sScrollAdjustcalledscrollBy(+103)to keep the reader's rows in place, withscrollHeightgrowing by the same 103 px. That undid the notch inscrollTop, but the distance from the end stayed exactly 600 px before and after. The reader had moved away; the wait could not see it. The wait now measures the distance from the end, which that adjustment leaves alone.Not a #2624 regression. An A/B of the unmodified script, alternating commits under
dori heavy, gave passes/runs of: 05c9133 (before #2624) 5/7, 9ef34f8 (#2624) 5/6, main 2/6. The step fails before #2624 too; #2624 changes when rows get measured, so it lands more often. NoscrollToEndor follow write appears in the trace.file-viewer-regression.ts: "video not visible"The CI failure came right after
setFileOpen("panel")reloads the page:videoLink.click()was a pointer click on a transcript link while the reloaded chat followed to its end, so the click landed on nothing and no popup opened (0 "locator resolved" lines on CI and locally). The script's own header comment describes this trap, and its other steps already useactivateInTranscript. Under load, three more steps hit the same trap: after agoto(big code), after the panel closes (the extensionless and unknown-text loop, which keeps the link focused so the focus-return assertion still holds), and after a reload and Back at 390 px. The click on the framed page's table-of-contents link is dispatched to the link: the frame's own navigation is under test, not where the panel lays the frame out.files-prompt-regression.ts:71: Escape left Files open after a pane switchNot reproduced in about 435 local attempts (15 per run, fresh pages, 6x CPU throttle, load up to 92), and nothing found by reading the code. The Escape check stays: it is the only place a script checks Escape closing Files. When it fails now, the script writes what decided it to the log and to
files-<page>-escape-diagnostics.jsonin the browser-evidence artifact: whether a window keydown probe saw the key, the focused element, the modal and dialog stack, whether FilesDialog stood down (file or diff over it, native modal), and any open picker. Tracked as #2631.relay-media-browser-qa.ts:44: "Timed out: copied-link clipboard event"Seen inside
relay-e2e-regression.tson bef2be1 (run 41568570526). The stubbedwriteTextalways resolves, so the click never reached Copy link.copy.click({ force: true })is aimed at where the button was, under a frozen browser clock, while the viewer may still move it. The click is now dispatched to the button itself; the clipboard listener is still subscribed before it.Validation
All runs went through
dori heavy; host load ranged from about 4 to 92 (70 CPU hogs for part of it).bun run check run, isolated herdr session). Earlier rounds under load caught the other lost-click steps fixed here.bun run check fast: success on 6069b0a. An earlier run caught a regression in this branch:ci-browser.test.tsforbids??on evidence dirs (The browser lane loses its evidence folder before omo-plan-browser-regression in bun run check full #1554). Fixed with||.activateInTranscriptwaits for a frame that section lacks; thewheelUpcallers assert the distance afterwards.No changelog fragment: test-only.