Uh oh!
There was an error while loading. Please reload this page.
test(e2e): Port nextjs-app-dir to span streaming - #23905
Merged
Merged
Conversation
Contributor
size-limit report 📦
|
chargomeforce-pushed
the
test/e2e-port-nextjs-app-dir
branch
3 times, most recently
from
September 2, 2026 10:14
632f95f to
1d04c79Comparechargomeforce-pushed
the
test/e2e-port-nextjs-app-dir
branch
from
September 2, 2026 10:58
1d04c79 to
a5156feComparechargome
marked this pull request as ready for review
September 2, 2026 13:12
andreiborza
approved these changes
Sep 2, 2026
JPeer264
approved these changes
Sep 2, 2026
| // Streamed spans are flushed across multiple envelopes as they end, so the server-component child spans | ||
| // can arrive in a different (earlier) envelope than the `is_segment` root span. Accumulate spans across | ||
| // envelopes until the root span (which ends last) is seen. | ||
| function collectSpanNamesUntilSegment(segmentName: string): Promise<string[]> { |
Member
There was a problem hiding this comment.
q: You think that might make sense to move into our utils folder?
Removes the `traceLifecycle: 'static'` pins and rewrites the specs onto streamed spans. Server-component and route-handler tests assert on children of a segment span. Streamed children are flushed as they end, so they can arrive in an earlier envelope than the segment; these use `collectStreamedSpans` and accumulate until the segment span (which ends last) is seen, following `nextjs-16-streaming`. Request headers carry over: they are attached to the span as `http.request.header.*` attributes, so the `x-yeet` and `User-Agent` assertions are kept in that form. Two things had no span v2 equivalent and were dropped: - Transaction-side `tags` (isolation scope) and `extra`. Nothing maps scope tags or extra onto a streamed span - `applyScopeToSegmentSpan` only converts contexts. The error-side assertions still cover isolation scope, and the comments say so at each site. - The `contexts.runtime.name === 'vercel-edge'` matchers. Those only disambiguated the edge routes, which are uniquely named. Granular statuses are preserved: span v2 collapses `status` to ok/error, but an explicitly set status survives as the `sentry.status.message` attribute, so `invalid_argument`, `unauthenticated` and `not_found` are still asserted. For a span terminated by an exception that attribute holds the error text, which varies by Next.js version, so only the binary status is asserted there. The `router.back()` and `router.forward()` navigation tests are skipped: under streaming those navigations are tagged `browser.popstate`, losing the back/forward distinction. See #23909 Ref #23802 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
chargomeforce-pushed
the
test/e2e-port-nextjs-app-dir
branch
from
September 2, 2026 13:42
a5156fe to
c69c86aCompareUh oh!
There was an error while loading. Please reload this page.
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 freeto 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.
Ports
nextjs-app-dirto span streaming: removes thetraceLifecycle: 'static'pins and rewrites the specs onto streamed spans, usingcollectStreamedSpanswherever a test asserts on children of a segment span.Request headers carry over as
http.request.header.*span attributes. Transaction-sidetags/extrahad no equivalent and were dropped; isolation scope stays covered by the error-side assertions. Granular statuses survive assentry.status.message. Therouter.back()/router.forward()tests are skipped pending #23909.Ref #23802