Skip to content

test(nextjs): Tolerate aborted navigation in streaming RSC error E2E test#21847

Open
github-actions[bot] wants to merge 1 commit into
developfrom
fix/flaky-streaming-rsc-error-navigation
Open

test(nextjs): Tolerate aborted navigation in streaming RSC error E2E test#21847
github-actions[bot] wants to merge 1 commit into
developfrom
fix/flaky-streaming-rsc-error-navigation

Conversation

@github-actions

Copy link
Copy Markdown
Contributor

The streaming-rsc-error E2E test navigates to a page that intentionally crashes a streaming promise inside a Suspense boundary. When the streaming error interrupts the HTTP response, the browser navigation can reject (e.g. net::ERR_ABORTED / incomplete chunked encoding) after Sentry has already captured the error and the server transaction. In that case the bare await page.goto(...) throws and fails the test even though the SDK behaved correctly — producing the intermittent failure tracked in #21836.

This mirrors the long-standing pattern already used for other error-page navigations across the E2E suite (e.g. nextjs-13/tests/server/server-component-error.test.ts, the astro-* and remix apps): attach .catch(() => {}) to the navigation so an aborted response no longer fails the test. All assertions on the captured error and transaction events are unchanged, so no coverage is dropped.

Applied to all four streaming-rsc-error.test.ts occurrences (nextjs-15, nextjs-16, nextjs-16-bun, nextjs-16-cf-workers) since they share the identical race.

Root cause: the test asserted on captured Sentry events but also implicitly required the navigation to complete successfully; a streaming RSC error can abort the response, making page.goto reject non-deterministically.

Fixes #21836

…test

Fixes #21836

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

0 participants