Skip to content

Stabilize runtime error event tests in Rspack - #98743

Draft
sokra wants to merge 2 commits into
canaryfrom
codex/runtime-error-events-lifecycle
Draft

sokra wants to merge 2 commits into
canaryfrom
codex/runtime-error-events-lifecycle

Conversation

@sokra

@sokra sokra commented Sep 16, 2026

Copy link
Copy Markdown
Member

What?

Stabilizes the App Router runtime-error-events development suite across Rspack and Turbopack while preserving all 21 behavior assertions.

Why?

The suite created, patched, and removed global-error.tsx while the dev compiler was running. In release Rspack jobs, this could leave a stale special-file compiler entry and panic Rspack. The resulting server exit appeared as unrelated missing events, connection resets/refusals, and an afterAll timeout. Browsers from earlier cases could also leave preview state visible to later assertions.

How?

  • Builds each custom global-error variant in its own isolated fixture before starting the dev server, so special App Router entries remain stable for the compiler.
  • Explicitly closes browsers that publish runtime-error state, preventing preview state from leaking between cases.
  • Replays the server-console error through client navigation after clearing it, avoiding a second live source reversal while still verifying that deduplication resets and the same error is reported for the active document.

Verification

  • Six consecutive focused release-like Rspack dev runs with React 18.3.1 and packed packages: 126/126 tests passed
  • Focused Turbopack dev run: 21/21 tests passed
  • pnpm types:test-lib
  • Prettier and ESLint on changed files

@github-actions

github-actions Bot commented Sep 16, 2026 •

Copy link
Copy Markdown
Contributor

Failing test suites

Commit: 8e1b85f | About building and testing Next.js

pnpm test-dev-turbo test/development/app-dir/instant-navs-devtools/instant-navs-devtools.test.ts (turbopack) (job)

  • instant-nav-panel > history traversals > shows real content on forward after back while awaiting navigation (DD)
  • instant-nav-panel > transitions between capture types > should avoid showing stale SPA state when reloading from a captured SPA state into captured MPA state (DD)
Expand output

● instant-nav-panel › transitions between capture types › should avoid showing stale SPA state when reloading from a captured SPA state into captured MPA state

expect(received).toContain(expected) // indexOf

Expected substring: "/target-page/my-post"
Received string:    "http://localhost:41059/"

  809 |       // capture an MPA load of the wrong route.
  810 |       await retry(async () => {
> 811 |         expect(await browser.url()).toContain('/target-page/my-post')
      |                                     ^
  812 |       }, 10000)
  813 |
  814 |       await browser.refresh()

  at toContain (development/app-dir/instant-navs-devtools/instant-navs-devtools.test.ts:811:37)
  at retry (lib/next-test-utils.ts:940:14)
  at Object.<anonymous> (development/app-dir/instant-navs-devtools/instant-navs-devtools.test.ts:810:7)

● instant-nav-panel › history traversals › shows real content on forward after back while awaiting navigation

locator.waitFor: Timeout 60000ms exceeded.
Call log:
  - waiting for locator('[data-testid="dynamic-skeleton"]') to be visible

  278 |     await browser
  279 |       .locator('[data-testid="dynamic-skeleton"]')
> 280 |       .waitFor({ state: 'visible' })
      |        ^
  281 |     await browser
  282 |       .locator('[data-testid="param-skeleton"]')
  283 |       .waitFor({ state: 'visible' })

  at waitFor (development/app-dir/instant-navs-devtools/instant-navs-devtools.test.ts:280:8)
  at Object.expectTargetPageSpaShell (development/app-dir/instant-navs-devtools/instant-navs-devtools.test.ts:870:13)

This branch has not been deployed

No deployments
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