4794de398ea8337d223a91e207181c56fcf4ad76
3
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
8f9bc3fccf |
gui tests: the 37 other Settings tests act on rows once the page has drawn its last read of the settings, as the masking-rules tests do since #1653 (#1659)
Opening Settings reads the settings twice: the page's own read (showView), then the window's load() once the state is in. Each read redraws every row. A test that found a row after the first draw, and then called scrollIntoViewIfNeeded or boundingBox on it, failed when the second read landed in between. The errors were "Element is not attached", or a null box. #1653 fixed the three masking-rules tests and listed these 37 in #1659. Each of the 37 now calls watchSettingsReads(page) before every page.goto, and settingsDrawn(page) right after it. Right after goto is exact for ?view=settings: at boot, show(view) asks for showView's read before load() runs. load() sets load.done in the same run that then asks for its own read, so settingsDrawn's "load.done and every read asked for drawn" holds only once the second read is drawn. For a test opened on another page that clicks into Settings later, load is done by then, the click makes the only read, and the wait passes at once. watchSettingsReads now watches a page once, however many times it is opened, since some of these tests open one page several times. The page is unchanged. Reproduced with a generic injection (scratchpad inject1659.cjs, loaded with NODE_OPTIONS=--require). A route added at each goto holds the page's second GET /api/settings. It lets the read go just as the test calls scrollIntoViewIfNeeded or boundingBox, or waits on the page with waitForFunction (which settingsDrawn is), with a 4s timer as a backstop. This is #1653's injection, made generic. Before, injected, both engines, all languages: - 5 files red with the issue's error: - github-token: null box. - member-model-setting, searcher-pick, search-first and update-wait: "Element is not attached to the DOM". - 4 files red on a check of a row drawn from the first read: model-suffix-own, otel, readable-focus and warm-at-times. - 28 green. After, injected: 36 of the 37 files green, every held read let go by settingsDrawn's wait. otel stays red in WebKit at 360px. It is red the same way with no injection, on origin/main's own copy of the test. That cause is separate (the narrow nav laid out after setViewportSize returns) and has its own commit next. Plain (no injection), both engines, all 37 files: 460 cases passed and 2 failed, both otel's WebKit 360px check above. The 8 files red under injection before, injected again after, 5 rounds: 390 of 390 cases passed. |
||
|
|
62bee03287 |
gui tests: a Settings option is measured after the last save's answer has redrawn the page, so lightweight's Off is still attached when it is clicked ("Cannot read properties of null (reading 'x')", webkit zh, about 1 run in 4 under load) (#1177)
lightweight.test.cjs clicked Dock, waited only for its POST to reach the fake API, then called boundingBox() on Lightweight's Off. The answer to that POST runs renderSettings(), which replaces every segs control. When the redraw landed between Playwright resolving the button and measuring it, boundingBox() got a detached node and returned null. Diagnostics at the failure: two POSTs, #lightweightSegs swapped twice. The click helper now waits for prefsBusy === 0 before it measures. That condition holds only after renderSettings has run, and fonts.test.cjs waits on it the same way. Three sibling tests that act on a control their own earlier save redraws get the same wait: - keep-awake: drops its retry on a null box. - search-first: before reading and measuring the redrawn row. - skill-how: waits for the row the library's answer draws. Run under a loaded machine (load average 120-170): - lightweight, webkit zh: 8/32 failed before, 0/30 after. - whole files in Chromium and WebKit: lightweight 20 rounds, 160/160; keep-awake 4 rounds, 128/128; skill-how 10 rounds, 60/60. - search-first, webkit: still fails about 3 runs in 15, unchanged from upstream/main (3/15). The failure is at line 64, before this change: opening ?view=settings loads and draws Settings twice (show() and load()), and the row found by waitFor() is replaced. That is a separate cause in the page's startup, left for its own change. |
||
|
|
1e0829b125 |
gui, gateway, settings: the Usage page's agent rows show their cache hit rate, and web search can go to the search APIs first (#925, xiaozhu1337; #928, hypooo)
#925: an agent's row said "9.0M cached" but not what share of its prompt that was. Each row of the Agent (and Model, Account, Key) lists now adds "hit rate N%", counted as the Cache read tile counts it: cache read over input + cache read + cache write; a row with no cache read shows none. usage-hit-rate.test.cjs is new and fails without the change. #928: with both a provider that searches and a search API set up, Settings › Web search has "Search first with": Model search (as before, the default) or Search APIs. Saved as settings.searchFirst ("api", or empty for the model first); with the APIs first, webSearch asks them before the Kimi/Google own search and the searcher's model, which search only when every API fails. The Search APIs row says they are asked first. The row is shown only when both sides are set up. TestSearchAPIsFirst and search-first.test.cjs are new and fail without the change. Test fixes on main: gui-ja/gui-de failed on ja/de strings with a second {agent} (the "is signed in to {user} now" warning) and on <name> written <名前>/<Name> in the docker-forward warning; quota-curve.test.cjs opened /blank, which its harness served as a 404 with no body, and Chromium refused to open it (ERR_HTTP_RESPONSE_CODE_FAILURE) — a harness bug, now served as an empty page; search-api.test.cjs waited for #status text that Brave's refusal had already set, so on Chromium it read the posts before the copy arrived. go vet, go build (darwin, GOOS=linux nogui, GOOS=windows) and go test -tags nogui ./... under a temp HOME pass; the GUI tests above pass on Chromium and WebKit with Playwright 1.63. |