Repository navigation
test(inbox-mode): run the inbox mode regression in three parts that each fit the lane's limit - #3865
Conversation
…rts that each fit the lane's limit The script's 134 cases need about 745 s on a loaded CI runner, so the lane's 600 s limit stopped it on every PR. INBOX_MODE_PART picks the part: themes (this file), panes and rail (two new files that set it and import this one). No case changes; the later parts are wrapped and indented (review with -w).
|
No actionable comments were generated in the recent review. Summary
Merge Risk:
|
Merge passMerged head
One reviewer: test-only. One reviewer at this head (test-only: the inbox regression script, its two new part files, ci-browser.sh, tsconfig.tools.json, one docs line): Codex Terra CLEAR. From ci-loop: #3856's inbox regression ran past the 600 s per-script cap on a loaded runner and reddened every PR's browser job; it now runs in three parts by INBOX_MODE_PART (themes, panes, rail), all 134 cases kept, 89 s / 150 s / 117 s alone in the runner image. |
… lane's limit (#3892) ## What `scripts/ui-regression.ts` ends at the browser lane's limit for one script (600 s, exit 124) on loaded runners and so reddens "Browser regression (ui-regression)": main (run 43685347171, and df92f77's run), #3876, #3873 (run 43699760401, `FAIL scripts/ui-regression.ts (600.6s) exit=124`). It is not hung: it passes check after check until the limit stops it. Alone in the CI runner image on one 6-CPU slot it takes **331.1 s** for its 85 checks. CI's browser jobs run about 2.4x slower than that, about 795 s, well past 600 s. ## Fix (test-only) The script runs in four parts, each from its own server and browser: - `main` (`scripts/ui-regression.ts` itself): the desktop page's stateful flow and the phone pages after it; - `terminal` (`scripts/ui-terminal-regression.ts`): the terminal's keys (`checkCommandBackspace`, `checkCtrlEnter`, `checkCommandArrows`), `checkTerminalInput`, the held drafts, a phone's input line and the attach; - `ime` (`scripts/ui-ime-regression.ts`): the Safari, iPad and Linux IME replays; - `access` (`scripts/ui-access-regression.ts`): sign out on a server with a token, and the relay panel. No check is dropped, and no check's code changes except the helper fix below. Each part's code is wrapped in `if (part === …)` and indented by two spaces (no multi-line string sits inside, so no text changes). **The order of the main flow changes.** Three groups of checks move: - the closed-pane, row-menu and selection checks ("closed and obsolete saved panes recover their selection") now run right after the phone's suggestion-chip check, not after the terminal and IME checks; - the three key checks (`checkCommandBackspace`, `checkCtrlEnter`, `checkCommandArrows`) leave their place between the Shift+Enter check and the pane-shortcut check for the `terminal` part; - `checkTerminalInput`, the held drafts, a phone's input line and the attach go to `terminal`, the IME replays to `ime`, and sign out and the relay panel to `access`. The moved checks open pages of their own; `browser`, `origin` and the two panes are all they take. The PASS-line comparison under Validation (53 + 27 + 3 + 2 = 85, each exactly once, all passing) is the evidence that no later step depended on state the moved checks left behind. Review with `git diff -w`, or `--color-moved` for the moved blocks. The new entry files are 10 lines each. No wait or timeout is added to `ui-regression.ts`, and `scripts/fixed-sleeps.json` is unchanged. One helper needed a fix: `checkCommandBackspace` pressed its first key as soon as the page was live. In the unsplit script the desktop page had attached that pane 17 s before, so the key was always taken. On a fresh server (the `terminal` part) the first Backspace went out before the pane's `input-ready` and was not sent. It now waits for `input-ready` (bounded at 15 s) before its first key, in both of its contexts, as `checkCtrlEnter` and `checkCommandArrows` already do. Its watcher is attached before the page loads and only records the frame. The promise and its timer exist only inside the wait that is awaited, so a failed load leaves nothing to reject unhandled. Settling clears the timer and takes off the page's and the sockets' listeners. No fixed sleep is added. ### Herdr sessions: parts side by side share none `BROWSER_WORKERS: 2` runs two of these scripts at once, and `ci-browser-parallel.ts` spawns each with the lane's whole environment. That includes the `HERDR_TEST_SESSION` and `HERDR_SOCKET` of the job's one `bun run check run`, so as first pushed, every part joined that one herdr session and made the same `ovis-test-browser-a`/`-b` workspaces (CodeRabbit's finding on ci.yml). A run of `main` and `terminal` side by side the CI way (`bun run check run -- bun scripts/ci-browser-parallel.ts`, two workers) at d3af150 showed it. Mid-run, the lane's session `check-99f883` listed `["ovis-test-resident","ovis-test-browser-a","ovis-test-browser-a","ovis-test-browser-b","ovis-test-browser-b"]`, and `main` failed after 19.8 s with `Timed out: the other pane is the palette's only result`: its palette search for `ovis-test-browser-b` found `terminal`'s workspace too. Before, only the scripts' timings kept the two apart. Now: - `scripts/ui-regression.ts` run itself is always `main` (`import.meta.main`), on the session the environment names: the lane's. - Each other part's entry file runs it on a herdr session, config and state of its own and stops that session after, through `scripts/own-herdr.ts` (`runOnOwnHerdr`). That helper is the UI context scripts' isolation, moved out of `scripts/ui-contexts-run.ts` unchanged, and `runIsolatedUiContextChecks` now calls it. So at most one script in the job (`main`) uses the lane's session. - The entry files pass their part explicitly, and an inherited `UI_REGRESSION_PART` cannot make `bun scripts/ui-regression.ts` skip the main flow. The script's first line names its part, session and socket, e.g. `ui-regression part terminal: herdr session check-1a8332, socket /tmp/hwc-8d8pQi/config/herdr/sessions/check-1a8332/herdr.sock` beside `ui-regression part main: herdr session check-3220a8, …`. - `scripts/pages-gate.test.ts`'s guard test (refuses unit and live runs before touching herdr) now covers the three entry files too. ### This PR touches `.github/` and `package.json` - `.github/workflows/ci.yml`: the three new scripts are added to browser-main's `BROWSER_SCRIPTS` (so that job still runs all of ui-regression) and to browser-other's `BROWSER_EXCLUDE` (so nothing runs twice). `BROWSER_WORKERS` stays 2. - `package.json`: `test:ui` runs the three new parts too, so the local UI command stays complete. The other option was having the parallel runner expand one entry into parts. It would still have needed `test:ui` changed, and it would change how the runner reads `ci-browser.sh` and the timings table. So this PR follows #3865 instead. **It touches a workflow and `package.json`, so it waits for GitHub's own checks and a real review.** Also updated: `scripts/ui-contexts-run.ts` (now calls `scripts/own-herdr.ts`), `scripts/ci-browser.sh` (the new scripts, and the list that runs without evidence capture), the same list in `scripts/ci-browser-parallel.ts`, `scripts/pages-gate.test.ts` and `scripts/ci-browser.test.ts` (the lists they pin), and `docs/development.md`. `scripts/ci-browser-timings.json` is not edited: the new parts start first until `bun scripts/ci-browser-timings.ts` takes their seconds from CI runs. ## Validation All runs are in the CI runner image (`herdr-ci-runner:local`, own network namespace), pinned to one heavy slot, built with `bun install --frozen-lockfile && bun run build`, with `CI=true RUNNER_ENVIRONMENT=self-hosted BROWSER_RETRY=0`. The timings table is from the first push, on 6-CPU slots, running `bun scripts/ci-browser-parallel.ts` without `check run`. | script | before (alone) | after (alone) | |---|---|---| | `scripts/ui-regression.ts` | 331.1 s (85 PASS) | 98.1 s (`main`, 53 PASS) | | `scripts/ui-terminal-regression.ts` | – | 52.7 s (27 PASS) | | `scripts/ui-ime-regression.ts` | – | 98.0 s (3 PASS) | | `scripts/ui-access-regression.ts` | – | 34.5 s (2 PASS) | 53 + 27 + 3 + 2 = 85. The sorted PASS lines of the unsplit run equal the union of the four parts' PASS lines, each exactly once. The only textual difference is a pasted screenshot's timestamped file name. At CI's observed 2.4x, the slowest part comes to about 235 s against the 600 s limit. At this push, on 4-CPU slots (2 cores, both threads), as the job runs it: `CHECK_DIR=… BROWSER_SCRIPTS=… BROWSER_WORKERS=2 bun run check run -- bun scripts/ci-browser-parallel.ts`: - `main` and `terminal` side by side (`BROWSER_SCRIPTS=scripts/ui-regression.ts,scripts/ui-terminal-regression.ts`): at d3af150 **1/2 passed** (`main` failed after 19.8 s on the shared session, as above). At this head, **3 runs, 2/2 passed each** (167.0 s, 131.7 s and 132.5 s). In each run, the lane's session listed one `ovis-test-browser-a`/`-b` mid-run, and `terminal` named a session of its own. - browser-main's whole script set (the six scripts, `BROWSER_WORKERS=2`): **6/6 passed in 472.0 s** (ui-regression 118.8, terminal 65.3, ime 132.6, access 48.4, ui-contexts 345.8, ui-contexts-layout 143.2 s). One earlier run failed in `checkUpdateNotice` only because `dist/` had been built at an older commit: that check compares the client's built-in revision with `git rev-parse HEAD`. Rebuilt at the commit, it passed. - At the first push: the same set, 6/6 in 553.5 s. - `bun run check fast`: passed (exit 0), including `scripts/pages-gate.test.ts`, `scripts/ci-browser.test.ts`, `scripts/ci-browser-parallel.test.ts`, `scripts/ci-browser-timings.test.ts` and `scripts/conventions.test.ts`. - Skipped: `bun run check full` and the integration lane (no server, shared or src code changes), browser-other's scripts (none changed), Windows/macOS. ## Not in this PR: `scripts/ui-contexts-regression.ts` is next It takes **276.5 s alone** in the same image (over the ~250 s line) and 414.8 s beside one other script. In CI it was seen at 565 s. Its slowest helpers are `checkTabMenu` 42.2 s, `checkUpdateNotice` 31.4 s, `checkNewTabTypeAhead` 21.0 s, `checkMobileTabs` 16.5 s, `checkDroplet` 14.4 s, `checkUsageMeters` 12.9 s and `checkAlertSound` 12.3 s. A third group in `ui-contexts-checks.ts`, as `layout` was split off in #3242, would bring it well under. It is left out so this PR stays small.
What
scripts/inbox-mode-demo-regression.ts(#3856) is stopped at the browser lane's limit for one script (600 s, exit 124) on loaded runners, and so reddens every PR's "Browser regression (other scripts)": #3855 (twice), #3861, #3864. It is not hung: its log passes case after case until the limit stops it.Alone in the CI runner image on 6 CPUs it takes 310 s for its 134 cases; on CI's loaded runners it had reached about case 108 of 134 when the 600 s ran out (about 2.4 times slower), so the whole script needs about 745 s there.
Fix (test-only)
The script runs in three parts, each from its own browser and demo app, chosen by
INBOX_MODE_PART:themes(scripts/inbox-mode-demo-regression.tsitself, the default): the cases run in light and dark (cases 1-54);panes(scripts/inbox-mode-panes-demo-regression.ts): terminals, splits, the focus, rows, the first paint, a lost connection, up to the system Back with a thread's More open;rail(scripts/inbox-mode-rail-demo-regression.ts): a gone pane's addresses, the ways in, the column at every width, the rail.No case is dropped or changed. The two later parts are wrapped in
if (part === …)blocks and indented by two spaces (no multi-line template string inside them, so no text changes);lightanddesktop, the only values both use, move above them. Review withgit diff -w(about 15 lines in the script). The two new files are registered inscripts/ci-browser.shandtsconfig.tools.json, anddocs/development.mdsays which part has what. No wait or timeout is added or changed; the lane's limit stays 600 s.Validation
In the CI runner image (
herdr-ci-runner:local, pinned to one 6-CPU slot), each part alone:bun scripts/inbox-mode-demo-regression.ts(themes): 54 passed, 0 failed, 89 s;bun scripts/inbox-mode-panes-demo-regression.ts: 43 passed, 0 failed, 150 s;bun scripts/inbox-mode-rail-demo-regression.ts: 37 passed, 0 failed, 117 s.54 + 43 + 37 = 134, the cases of the whole script. At CI's observed 2.4x, about 215 s, 360 s and 280 s against the 600 s limit.
bun run check fast: passed (exit 0).