Repository navigation
Renderer test helpers: bound each stage request, and say what the stage last showed - #153
Merged
Merged
Conversation
…ge last showed
A stage the renderer harness drives through openStage could stop answering:
WebKit runs the sandboxed renderer frame in the host page's process, so a
renderer stuck in its document stops the stage page with it, and the page's
own waits (a probe measurement's 10 s, a frame's arrival at 60 s) never fire.
diff.spec's graph test then waited the whole 360 s test timeout on a
measure('settle'), or on a locator in the frame, twice on #147.
Each request a StageHandle makes of the page (load, seek, measure, state, …)
now fails after 90 s in the test process, naming the request, the scenario
and the stage's last known state (status, renderer, mode, progress painted,
height asked for, errors) and when the page last answered. The page's own
bounds stay where they were; this one only catches a page that no longer
runs.
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
🟡 Changes recommended
The timeout error incorrectly asserts that the page is frozen, although a missing renderer paint acknowledgement can cause the same timeout while the page remains responsive.
1 open issue
What changed in this PR
This PR adds test-process timeouts to renderer stage requests, limiting waits when the page cannot complete a request. It improves diagnostics for the hangs tracked in #151 without fixing the underlying WebKit issue.
Changes:
- Bounds individual stage requests at 90 seconds, while leaving
runChecksunbounded. - Reports the request, scenario, last known stage state, and time since the last response.
- Adds a unit test for timeout diagnostics.
| File | Description |
|---|---|
packages/renderers/testing/test/helpers.test.mjs |
Tests timeout failures and their diagnostic details. |
packages/renderers/testing/playwright/index.ts |
Wraps stage requests with the timeout helper and exports its limit. |
packages/renderers/testing/playwright/bounded.ts |
Implements request timeouts and last-known-state tracking. |
Review effort: Balanced
…causes Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
3 tasks done
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.

The flake
The renderer harness's
diff.spec.ts:36"graph: diff mode marks every change in its own form" (webkit-desktop, 2/4) failed twice on #147 (run 44930946920). Both times it waited the full 360 s test timeout: once onlocator.countin the frame, once onstage.measure('settle'). The page itself hangs; that's tracked in #151.Why the probe's own timeouts didn't help
The probe's requests are bounded already, but inside the page:
StageProbe.measuregives up after 10 s, andStage.arrivedafter 60 s. WebKit runs the sandboxed renderer frame in the host page's process, so a renderer stuck in its document stops the host page's event loop too. Those timers never fire, and the trace shows the screencast stopping as well. Only the test process can still notice.Fix
packages/renderers/testing/playwright/bounded.tsadds a bound in the test process. Every request aStageHandle(fromopenStage) makes of the page now fails after 90 s:loadScenario,load,subject,seek,measure,state,select,hover,filter,setOptions,setEnvironment,setWidthandaction. The error names:For example:
The stage page didn't answer measure(settle) for graph/npm-express-5 within 90 s: a renderer that never acknowledged its paint, or a page (with the renderer frame in its process) that stopped running. Last known: status ready, renderer graph, diff, progress 1, painted 1, asked for 1217px; it last answered state 0.1 s before.90 s sits above every in-page bound: a frame's arrival waits up to 60 s, a probe up to 10 s, and heavy scenarios load in under 15 s on Linux WebKit. So it fires only for a request that is stuck (a renderer that never acknowledges a paint, which
seekwaits on without a bound of its own, or a page that no longer runs), and a hang now costs 90 s instead of the 360 s test timeout.runChecksisn't bounded: it runs every check, and its length depends on the renderer. A unit test intest/helpers.test.mjscovers the failure message.Relates to #151 (the underlying WebKit and graph renderer hang).