Skip to content

test(e2e): pin streaming-error loading state on the raw stream, not the transient DOM - #696

Merged
ivogt merged 1 commit into
mainfrom
fix/streaming-error-transient-assert
Jul 5, 2026
Merged

ivogt merged 1 commit into
mainfrom
fix/streaming-error-transient-assert

Conversation

@ivogt

@ivogt ivogt commented Jul 5, 2026

Copy link
Copy Markdown
Collaborator

The direct-load streaming-error test raced hydration: it asserted the loading fallback was visible in the live DOM before the error boundary replaced it, but that window is hydration-speed-dependent and #694's head-executing module scripts shrink it by design. page.goto resolves at load — for this route the 500ms error has already streamed by then — so on a warm runner hydration swaps in the error boundary before the first locator poll. Observed: failed 4/4 on a fast local preview and on the CI shard rangojs-router-e2e (production, 1, 2) of the #694 head run; passed on slower runners and on main's post-merge run.

The contract worth pinning is deterministic on the raw stream and unaffected by hydration timing:

  1. The shell ships the fallback markup (data-testid="streaming-error-loading").
  2. React's errored-boundary marker (<!--$!-->) streams after it in the same body.
  3. The browser lands on the error boundary.

The SPA-navigation sibling test keeps its DOM assertion — its loading window is the full 500ms handler delay on a client transition, not a hydration race.

Semantics: no product behavior change; test-only.

Test plan:

  • Red-before-green: old assertion failed 4/4 against a warm local production preview; new form passed 4/4 production + dev.
  • Full error-boundary.test.ts: 18/18 across both projects.
  • check:e2e-bucketing, lint, format clean.

…he transient DOM

The direct-load streaming-error test asserted the loading fallback was
visible in the live DOM before the error boundary replaced it. That window
is hydration-speed-dependent, and #694's head-executing module scripts
shrink it by design: page.goto resolves at load (the error already
streamed), and on a warm runner hydration swaps in the error boundary
before the first locator poll — failed 4/4 on a fast local preview, flaked
on CI shard rangojs-router-e2e (production, 1, 2), while slower runners
pass. The contract worth pinning is deterministic on the stream: the shell
ships the fallback markup, React's errored-boundary marker (<!--$!-->)
arrives later in the same body, and the browser lands on the error
boundary. The SPA-navigation sibling keeps its DOM assertion — its window
is the full 500ms handler delay on the client transition, not a hydration
race. Red-before-green: old form 4/4 red locally, new form 4/4 green
production + green dev; full error-boundary file 18/18.
@pkg-pr-new

pkg-pr-new Bot commented Jul 5, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/@rangojs/router@696

commit: 86cf5a5

@ivogt
ivogt merged commit c852048 into main Jul 5, 2026
34 checks passed
@ivogt
ivogt deleted the fix/streaming-error-transient-assert branch July 5, 2026 21:54
ivogt added a commit that referenced this pull request Jul 5, 2026
…ts capture starves sibling captures on GH runners

With the composition test already CI-dev-skipped, the warmup's module-warm
GET was the last CI trigger of its background capture, whose per-request
/__rsc_prerender app-graph re-import grinds the runner long enough to blow
SIBLING captures' 5s quiet windows — the rotating eternal-MISS victim seen
across four CI runs (warmup on one shard, the composition probe, then
/ppr-shell?probe=stream once the rest were quiet; #695/#696 green before
the route existed; local runs unaffected). Locally the route stays warmed
and every test runs. Lift with the dev-endpoint capture hardening follow-up.
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.

1 participant