Commit Graph
2 Commits
Author SHA1 Message Date
yetone ce8b67de37 gui tests: a page's first load gets a minute, not a click's 5s (#4470)
claude-switch-only set page.setDefaultTimeout(5000) and then called
page.goto with no timeout of its own, so Playwright held the first load
of app.js, i18n.js and the plugins to the 5s bar meant for clicks. On a
busy box (a whole-suite run at load 130-160) that load took longer and
goto timed out. The same pattern is in 988 GUI test files (1174 pages):
every one of them now also sets setDefaultNavigationTimeout(60000) on
the same page, right after its default, so goto, reload and waitForURL
wait on the load itself with room, while clicks and waits keep their
short bar. group-from-model-add's own 20s navigation bar is raised to the
same minute. claude-switch-only also gives its first provider row (drawn
from the page's first reads) a minute before clicking it.

nav-timeout.test.cjs (no browser) reads every GUI test file and names
each page given a default under a minute without a navigation timeout of
at least a minute, so a new file can't bring the pattern back.

What was run (WSL magpie-desktop, Playwright 1.62.0, load 70-260 from
other sessions):
- node --check on every file in internal/gui/tests: all parse.
- nav-timeout.test.cjs against origin/main's test files: red (names the
  1174 pages); against this tree: its only reds were my own probe copies
  of the old files, since removed.
- By hand: claude-switch-only with app.js served 7s late (a busy box's
  first load), --test-name-pattern "1100 en": origin/main's file 4 of 4
  red with "page.goto: Timeout 5000ms exceeded"; this file 4 of 4 green.
- claude-switch-only.test.cjs, both engines, en/zh/ja/de, 1100 and 420:
  32 of 32. group-from-model-add, usage-access-key-card and i18n-keys:
  green. agent-plugin-agents: Chromium green; WebKit's de 420 subtest red
  on a 5s waitForFunction at line 115 (a wait after load, not the
  navigation), at load ~230.

Not tried: the whole GUI suite (about 1000 files; the change is one
mechanical line per page), Windows or mote (mote's browsers, #4125).
2026-10-31 02:09:18 +08:00
yetone 9d78a95ef8 routing: a flight's arc is laid again only when its ends move, and account names are read from answers without Object.entries (#1481)
Two smaller sources of the Routing page's steady garbage were left once
the rows were kept. Both were measured with CDP sampled allocation at one
request a second:

- via's j laid the arc through magpie on every frame of a flight: a new
  path string and its control points sixty times a second, though its
  ends had not moved. It now keeps the ends it laid and returns when they
  are the same. That path was 10-13 MB/min and is now ~5.
- noteAccounts walks every API answer (Routing's trace once a second) to
  learn account names for Hide accounts. Object.entries made an array for
  each object and one for each key, ~7-8 MB/min on Routing. It now walks
  with for...in and Object.hasOwn, so the same keys are visited.

Routing ~100 -> ~86 MB/min (from ~149 before the previous commit).
As with the previous commit, the WebKit WebContent footprint did not
change in a 12-minute A/B (119 -> 260 MB before, 117 -> 257 MB after).

Test: routing-steady-garbage.test.cjs, in chromium and webkit, en and zh.
It counts the arc's d writes against the frames drawn while a request
flies, and counts Object.entries calls while noteAccounts reads 50 routes.
It also checks that all 50 accounts are still found. On HEAD's client.js
the arc was laid 32 of 41 frames, and on HEAD's app.js Object.entries ran
201 times: both red.

Run: the 117 GUI files these changes reach (routing-*, panel-routing*, and
every file that drives the Routing page or noteAccounts), chromium and
webkit, their languages and widths, at concurrency 4 on a machine at load
average 500-860 from other sessions: 1520 tests, 1402 pass, 118 fail. Of
the 118, 74 are page.goto timeouts and most of the rest locator timeouts.
The 37 red files were run again at concurrency 2: 726 tests, 45 fail.
The four files red each time were run with HEAD's app.js and client.js
(these changes taken out) and are red there the same way:
group-new-head (4 of 4), routing-bodies (10 of 10), routing-keys-fold
(8) and routing-model-rest (load-dependent, 4 to 12). On origin/main
d9c6a60d8's GUI tree routing-bodies and routing-keys-fold are red too;
group-new-head passes there and goes red with 4b000ecc2 (its rowClock
throws "Invalid time value" on a route with no time), which is on this
branch and not part of this change.
routing-request-metrics fails waiting for the metric menu's Cost item
on this tree (3 of 4 alone), on HEAD (4 of 4) and on origin/main (2 of
4). The other reds were page.goto or locator timeouts under this load.
The two new files passed 4 of 4 each in the full run. No Go changed.

Not tried: real WebView2 on Windows, and the real macOS app.
2026-10-20 20:23:58 +08:00