Repository navigation
Port the main Next.js E2E test suites to span streaming #23802
Description
Port these E2E test applications to span streaming (12 apps). These are the full Next.js suites: server components, route handlers, middleware and the runtime variants, plus the smaller feature fixtures.
Out of scope, for the record:
nextjs-15-basepath,nextjs-15-intl,nextjs-16-trailing-slashare the client routing slice, done in test(e2e): Port Next.js routing test apps to span streaming #23797nextjs-16-streamingandnextjs-16-streaming-cacheComponentswere always streamingsupabase-nextjsis already ported and usescollectStreamedSpanstodaynextjs-sourcemapshas no tests,nextjs-otlpis errors-only
Apps
| App | Test files | waitForTransaction call sites |
|---|---|---|
| nextjs-16 | 26 | 48 |
| nextjs-15 | 18 | 47 |
| nextjs-16-cf-workers | 14 | 33 |
| nextjs-app-dir | 10 | 39 |
| nextjs-pages-dir | 10 | 20 |
| nextjs-16-bun | 9 | 25 |
| nextjs-14 | 4 | 21 |
| nextjs-16-cacheComponents | 2 | 9 |
| nextjs-orpc | 2 | 5 |
| nextjs-15-t3 | 2 | 4 |
| nextjs-16-tunnel | 1 | 6 |
| nextjs-16-userfeedback | 1 | 0 |
Roughly 6,800 lines of specs and 253 waitForTransaction call sites, so this is worth splitting across several PRs rather than one.
What to do
For each app:
- Remove the
traceLifecycle: 'static'pin added in test(e2e): Disable span streaming in e2e test applications #22590 from everySentry.init(client, server, edge). - Rewrite the specs from transaction envelopes to span v2:
waitForTransactionbecomeswaitForStreamedSpan/waitForStreamedSpansevent.transactionbecomesspan.namecontexts.trace.opbecomesgetSpanOp(span)plusspan.is_segmentcontexts.trace.data['x']becomesspan.attributes['x'], which has the shape{ value, type }transaction_info.sourcebecomes thesentry.segment.name.sourceattribute
- Streamed child spans arrive across several envelopes, so use
collectStreamedSpanswherever a test asserts on children of a segment span. These suites assert heavily on server component and route handler children, so this is the bulk of the work.
Client pageload and navigation names carry over when Next resolves the route from its manifest. A pageload on a route the manifest does not know falls back to Pageload, and server-side http.server names go low cardinality.
Reference app: nextjs-16-streaming, which already covers the parameterized case, the fallback case, route handlers and server components.
Keep static trace lifecycle coverage
Before porting this group, duplicate nextjs-16 as-is into nextjs-16-static and leave that copy on the current transaction-based specs. That keeps the static trace lifecycle covered once the rest of the group moves to streaming.
The copy is verbatim; only the app name changes:
package.json->namestart-event-proxy.mjs->proxyServerName- every
waitForTransaction/waitForError/waitForSessioncall intests/
Keep traceLifecycle: 'static' in the copy's Sentry.init calls. The e2e matrix discovers apps by directory, so no CI config change is needed.
nextjs-16 is the largest app in the group at 26 test files, so nextjs-app-dir is a cheaper representative if the copy turns out to be too heavy for CI.
Activity
linear-code commentedon Sep 1, 2026
JS-3486
[-]Port remaining Next.js E2E test apps to span streaming[/-][+]Port the main Next.js E2E test suites to span streaming[/+]test(e2e): Add a static trace lifecycle Next.js 16 test app
test(e2e): Bring streaming cacheComponents app to parity with the sta…
test(e2e): Port nextjs-orpc to span streaming
test(e2e): Port nextjs-orpc to span streaming
test(e2e): Port nextjs-orpc to span streaming
test(e2e): Port nextjs-app-dir to span streaming
test(e2e): Port nextjs-app-dir to span streaming
test(e2e): Port nextjs-pages-dir to span streaming
test(e2e): Port nextjs-app-dir to span streaming
18 remaining items
test(e2e): Port nextjs-16-cf-workers to span streaming
test(e2e): Add a static trace lifecycle Next.js 16 test app (#23834)
test(e2e): Bring streaming cacheComponents app to parity with the sta…
test(e2e): Port nextjs-16-userfeedback to span streaming (#23867)
test(e2e): Port nextjs-16-tunnel to span streaming (#23868)
test(e2e): Port nextjs-15-t3 to span streaming (#23869)
test(e2e): Port nextjs-orpc to span streaming (#23870)
test(e2e): Port nextjs-app-dir to span streaming (#23905)
test(e2e): Port nextjs-pages-dir to span streaming (#23914)
test(e2e): Port nextjs-14 to span streaming (#23921)
test(e2e): Port nextjs-15 to span streaming (#23923)
test(e2e): Port nextjs-16 to span streaming (#23924)
test(e2e): Port nextjs-16-bun to span streaming (#23925)
test(e2e): Port nextjs-16-cf-workers to span streaming (#23926)