Skip to content

Host browser test: the documents probe reports both results in one message - #51

Merged
agorischek merged 2 commits into
mainfrom
agorischek/nested-probe-race
Nov 18, 2026
Merged

agorischek merged 2 commits into
mainfrom
agorischek/nested-probe-race

Conversation

@agorischek

Copy link
Copy Markdown
Collaborator

Fixes the flaky host test "a renderer gets built-in renderer documents by name only, and can run one in a frame of its own", which timed out on WebKit desktop in `browser (packages/host/core, 1/3)` on #45 and #46 (for example, job 135040959158).

Cause

The hostile test renderer's `documents` probe (from #24) reported two things as `error` messages, one after the other:

  1. What the host answered: `documents graph=html; hostile=refused (…); no-such-renderer=refused (…)`.
  2. `nested graph ready`, once the graph renderer it nests had started.

A renderer's error replaces its previous one in the alert. When the nested frame became ready before Playwright read the alert, the first report had already been replaced, and `toContainText` waited for text that would never come back. The failing run's alert read: "The renderer reported a problem: nested graph ready". Locally it failed 17 of 30 times on WebKit desktop (`--repeat-each=30`).

Fix

The probe now sends one cumulative report, `documents …; nested graph loading|ready`, and sends it again when the nested renderer is ready. This is how the VS Code smoke probe in `nested-renderers.cjs` already works. The test waits for the full report, so it still requires the nested renderer to become ready under the nesting frame's policy. It still asserts that the request naming a path was dropped. Only the test renderer and the test change; the product is untouched.

Verified

  • With the fix, the test passed 30/30 on webkit-desktop and 30/30 on chromium-desktop (`--repeat-each=30`), after rebuilding Storybook, which serves `test-renderers/`.
  • The whole `browser/host.spec.ts` passes on webkit-desktop (38/38).
  • `tools check --fast` passes.

…ssage

The hostile renderer's documents probe sent two reports as `error` messages:
what the host answered, then "nested graph ready" once the nested graph
renderer started. Each report replaces the last, so when the nested frame
became ready before the test read the first report (often on WebKit, 17 of
30 local runs), the answers were gone and the test timed out. The probe now
sends one cumulative report, sent again when the nested renderer is ready,
as the VS Code smoke probe already does, and the test waits for both parts.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>

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.

🟢 Approval recommended

No active review issues were identified in the test-only changes addressing the browser-test reporting race.

No open issues 🎉

What changed in this PR

Fixes a race in the host browser test where nested-renderer readiness could overwrite document results before Playwright read them. Changes are limited to the test renderer and browser test; product code is unchanged.

Changes:

  • Make the documents probe report document results and nested-renderer status together.
  • Wait for the combined report while retaining the assertion that path-based requests are dropped.
File Description
tools/​storybook/​test-renderers/​hostile/​index.html Sends cumulative document results and nested-renderer status.
packages/​host/​core/​browser/​host.spec.ts Asserts document results and nested readiness in one report.

Review effort: Balanced

@agorischek
agorischek merged commit 22636a5 into main Nov 18, 2026
61 checks passed
@agorischek
agorischek deleted the agorischek/nested-probe-race branch November 18, 2026 19:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants