Repository navigation
Conversation
The suite slept 750ms after every navigation, every frame and every repaint. The case that walks a page's history spent five of those sleeps — 3750ms of its 4412ms — asleep, so it blew through the 5000ms budget on a runner a little slower than the one it was measured on. Nothing in the product had changed: the case failed on mainline on its own arithmetic. Every sleep is now a wait for the state the case asserts: the title the page shows, the generation the provider holds for it, the page's place in the target list, the frame that has arrived. A wait that never comes true fails the case at its own deadline with the state it waited for named, so the cases fail faster and say more than they did — the sleeps only ever guessed, and several of them guessed about something the provider already reports exactly. The streaming case opens each page's stream while that page is the one on screen, because Chrome renders the front page and throttles the ones behind it. Before, the second stream took the front and the first page produced no picture at all: the case passed on CI by luck and failed here every time. The four cases that drive a real browser and measured over 700ms are given a 30s budget, the number the repository's other real-browser suites use (browser-panel-live-navigation and workspace-browser-tab-acceptance; webui-dependency-check uses 60s for its own gate). The eight that measured under 250ms keep the default budget, so a case that suddenly takes seconds still says something. The teeth are in the waits: a broken navigation fails at the 3s wait deadline with the state it waited for named, not by running a budget out. Checked against a real Chromium: the case that failed on mainline went from 4412ms (4503ms here) to 1075ms, and the file from 39910ms to about 5200ms. Breaking the provider's back/forward on purpose fails the case in 3767ms with "timed out waiting for the back navigation to land"; breaking its generation counter fails two more, at 3851ms and 4146ms. The suite's Chrome discovery now knows about macOS, the way the provider's own candidate list does, so the suite runs — and can be checked — on a developer machine at all.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What broke
Mainline run 39879196689 (SHA
2bd9a2a1) went red on a test timeout, not on an assertion:Test Files 1 failed | 212 passed (213),Tests 1 failed | 3296 passed (3297),Verification failed at: test:webui.Re-running the same SHA passed. Nothing in the product had changed — the case failed on its own arithmetic.
Why it failed
The suite slept 750ms after every navigation, every frame and every repaint. The case that walks a page's history did five of those — 3750ms of its 4412ms asleep. The 5000ms budget it inherited (vitest's default; no
testTimeoutis set invitest.oss.config.mjs) therefore left about 588ms of headroom, and a runner a little slower than the one it was measured on went over the line.Measured on a real Chromium, the same case takes 4503ms here against 4412ms on the green CI run — the machine here is the same speed for this workload, so the local number is the CI number.
The sleeps were also guessing about things the provider reports exactly: whether a page is in the target list, which generation it holds, what title it shows, whether a frame arrived.
What this changes
Every sleep in the file becomes a wait for the state the case actually asserts:
waitFornever passes a condition that did not hold. A condition that throws is the page's own state (a loading page answers a read with an error), so it is asked again, and the last error is reported if the wait ends.Two things came out of the same file:
The budgets, and why only some of them
Four cases drive a real browser and measured over 700ms (756 / 844 / 1075 / 1199ms on an idle machine). Those four get a 30s budget — the number the repository's other real-browser suites use (
browser-panel-live-navigation.test.ts:23,workspace-browser-tab-acceptance.test.ts:67;webui-dependency-check.test.ts:1422uses 60s for its own gate). The eight that measured under 250ms keep the default 5s, so a case that suddenly takes seconds still says something.The teeth are in the waits, not in the budget:
WAIT_MSis 3000ms, well inside every budget including the default 5s one, so a failure is always the condition's and never the budget's. The longest wait a healthy page took was about 200ms.How it was checked
pnpm --filter @mavis/webui typecheck:testpasses.node scripts/run-vitest-suite.mjs webui: this file's 12 cases pass. The group reported2 failed | 207 passed | 4 skipped (213)— the failures are subprocess-spawning static-analysis checks timing out on a loaded machine (webui-dependency-check.test.ts,webui-role-check.test.ts), and all 148 pass when run on their own. Another group run failed only becausedist-webui/had not been built in that checkout. Neither is this file.timed out waiting for the back navigation to land; breaking its generation counter fails two more, at 3851ms and 4146ms, withtimed out waiting for the navigated page to advance its generation. All three are condition failures with a diagnostic — none is vitest'sTest timed out in 5000ms.Not addressed here
packages/webui/test/integration/isolated-chromium-screencast.test.tshas no explicit budget and its "keeps delivering frames" case sleeps 3000+500ms — 3500ms of 5000ms, the closest match to this one — andpackages/webui/test/integration/browser-use-real-input.test.tssleeps 750ms per navigation with no budget (a lower risk). Both also discover Chrome through the Linux-only path list, so they skip on a developer machine.test/vitest-suites.jsonandrelease/public-source.json.