Skip to content

Renderer test helpers: bound each stage request, and say what the stage last showed - #153

Merged
agorischek merged 2 commits into
mainfrom
probe-request-timeout
Nov 21, 2026
Merged

agorischek merged 2 commits into
mainfrom
probe-request-timeout

Conversation

@agorischek

@agorischek agorischek commented Nov 21, 2026 •

Copy link
Copy Markdown
Collaborator

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 on locator.count in the frame, once on stage.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.measure gives up after 10 s, and Stage.arrived after 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.ts adds a bound in the test process. Every request a StageHandle (from openStage) makes of the page now fails after 90 s: loadScenario, load, subject, seek, measure, state, select, hover, filter, setOptions, setEnvironment, setWidth and action. The error names:

  • the request and the scenario;
  • the stage's last known state: status, renderer, comparison mode, progress, progress painted, height asked for, and errors;
  • how long ago the page last answered, and which request that was.

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 seek waits 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. runChecks isn't bounded: it runs every check, and its length depends on the renderer. A unit test in test/helpers.test.mjs covers the failure message.

Relates to #151 (the underlying WebKit and graph renderer hang).

…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>
@agorischek agorischek added the ci:full Run every CI job on this pull request (re-run the workflow after adding it) label Nov 21, 2026
@agorischek
agorischek requested a balanced review from Copilot November 21, 2026 19:13

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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 runChecks unbounded.
  • 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>
@agorischek
agorischek merged commit 5fba711 into main Nov 21, 2026
53 checks passed
@agorischek
agorischek deleted the probe-request-timeout branch November 21, 2026 20:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ci:full Run every CI job on this pull request (re-run the workflow after adding it)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants