test(nextjs): Tolerate aborted navigation in streaming RSC error E2E test#21847
Open
github-actions[bot] wants to merge 1 commit into
Open
test(nextjs): Tolerate aborted navigation in streaming RSC error E2E test#21847github-actions[bot] wants to merge 1 commit into
github-actions[bot] wants to merge 1 commit into
Conversation
…test Fixes #21836 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
streaming-rsc-errorE2E 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 bareawait 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, theastro-*andremixapps): 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.tsoccurrences (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.gotoreject non-deterministically.Fixes #21836