Repository navigation
test: add non-adapter deploy snapshots to otel-middleware-trace - #100583
Merged
Merged
Conversation
Co-authored-by: Tobias Koppers <1365881+sokra@users.noreply.github.com> Co-authored-by: Luke Sandberg <210140+lukesandberg@users.noreply.github.com> Co-authored-by: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com>
Contributor
Tests PassedCommit: c3fac57 |
sokra
marked this pull request as ready for review
October 22, 2026 13:51
mischnic
approved these changes
Oct 22, 2026
sokra
added a commit
that referenced
this pull request
Oct 22, 2026
) ### What? Adds snapshots for deployments built without the adapter to `test/e2e/app-dir/otel-middleware-trace/otel-middleware-trace.test.ts`. Test-only change. ### Why? The v16.5.0-canary.23 release deploy tests ([run 39773330104](https://github.com/vercel/next.js/actions/runs/39773330104)) fail 20 of 30 tests in this file, on every retry, in `Run Deploy Tests (Turbopack)` and `Run Deploy Tests (Webpack)`. Those jobs deploy with `NEXT_ENABLE_ADAPTER=0`. The deploy snapshots were filled from PR CI, which deploys only through the adapter (`NEXT_ENABLE_ADAPTER=1`). `Run Deploy Adapter Tests` passes the same file. Without the adapter, the trace topology is the same: one trace, and the middleware and render are siblings under `Next.request` or the incoming context. Only the render's spans have the self-hosted shape: - the request span is unnamed (`GET` instead of `GET /page/page`); - `findPageComponents` → `loadRouteModule` spans appear; - the render's `instrumentation.ts` lifecycle spans are startup roots. Node.js middleware still emits its lifecycle spans inside the middleware span. ### How? - **Builder flag.** A new `isNonAdapterDeploy` flag selects non-adapter snapshots for deployments without the adapter, in the default render mode. - The snapshots are the complete received trees from that run. They were identical across Turbopack and Webpack and all 3 attempts. - The lifecycle-span test reuses the existing self-hosted snapshot. - **Existing snapshots unchanged.** All adapter, self-hosted and Cache Components snapshots stay as they are. Non-adapter deployments with Cache Components keep the existing assertions, because the release suite doesn't run that combination, so there's no observed tree to assert. - **No coverage dropped.** No deployment skips or known-failure entries. Verification: - **Mechanical checks.** The new literals were checked against the trees reconstructed from the CI logs. A check of which snapshot each of the 192 test/environment combinations selects confirms that only default-mode non-adapter deployments change. - **Local runs.** `test-start-turbo`, `test-dev-turbo` and `test-start-webpack` pass with no snapshot changes. - **Not confirmed by PR CI.** PR CI deploys only through the adapter, so it doesn't exercise the new snapshots. The next release deploy run confirms them. <!-- NEXT_JS_LLM --> <!-- fleet ce0ecb23-b14c-4679-92a9-e676130f618e --> Co-authored-by: vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com> Co-authored-by: Tobias Koppers <1365881+sokra@users.noreply.github.com> Co-authored-by: Luke Sandberg <210140+lukesandberg@users.noreply.github.com> Co-authored-by: Niklas Mischkulnig <4586894+mischnic@users.noreply.github.com> (cherry picked from commit f196a3a) Co-authored-by: Tobias Koppers <tobias.koppers@googlemail.com>
mischnic
pushed a commit
that referenced
this pull request
Oct 22, 2026
…0294, #100324, #100350, #100552, #100583) (#100542) Backports the OpenTelemetry request-trace stack to `releases/lts/active`: - #100349 Start the request span before route module preparation - #100294 Keep middleware and render in one OpenTelemetry trace as siblings (re-lands #100136, whose LTS backport #100226 was reverted in #100269) - #100324 docs: note that instrumentation-time spans don't join request traces - #100350 Emit instrumentation lifecycle spans in the request that registered it - #100552 Preserve deferred middleware instrumentation spans when the adapter throws - #100583 test: add non-adapter deploy snapshots to otel-middleware-trace. Without it, `otel-middleware-trace` fails the release deploy tests that deploy with `NEXT_ENABLE_ADAPTER=0`, as on v16.5.0-canary.23. The six canary merge commits are cherry-picked in order with `-x`, and all applied cleanly. The patch content is identical to canary's; only blob IDs and line offsets differ. ## Verification - `test/e2e/opentelemetry/instrumentation/`: `test-start-turbo` (122 passed) and `test-dev-turbo` (67 passed). The #100552 regression test fails without its `middleware.ts` change. - `test/e2e/app-dir/otel-middleware-trace`: `test-start-turbo`, `test-dev-turbo` and `test-start-webpack` (30 passed each, inline snapshots unchanged). The #100583 commit leaves the test file byte-identical to canary's. - Unit tests for `instrumentation-globals`, `tracer` and `forward-trace-context` (40 passed), plus `pnpm --filter=next types` - Built with `CI=true pnpm build-all` against the published `@next/swc` 16.4.2 binary. The backport touches no Rust. - PR CI deploys only through the adapter, so the non-adapter snapshots from #100583 are confirmed by the next release deploy run. <!-- NEXT_JS_LLM --> <!-- fleet ce0ecb23-b14c-4679-92a9-e676130f618e --> --------- Co-authored-by: vercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com> Co-authored-by: Luke Sandberg <210140+lukesandberg@users.noreply.github.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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
What?
Adds snapshots for deployments built without the adapter to
test/e2e/app-dir/otel-middleware-trace/otel-middleware-trace.test.ts. Test-only change.Why?
The v16.5.0-canary.23 release deploy tests (run 39773330104) fail 20 of 30 tests in this file, on every retry, in
Run Deploy Tests (Turbopack)andRun Deploy Tests (Webpack). Those jobs deploy withNEXT_ENABLE_ADAPTER=0. The deploy snapshots were filled from PR CI, which deploys only through the adapter (NEXT_ENABLE_ADAPTER=1).Run Deploy Adapter Testspasses the same file.Without the adapter, the trace topology is the same: one trace, and the middleware and render are siblings under
Next.requestor the incoming context. Only the render's spans have the self-hosted shape:GETinstead ofGET /page/page);findPageComponents→loadRouteModulespans appear;instrumentation.tslifecycle spans are startup roots. Node.js middleware still emits its lifecycle spans inside the middleware span.How?
isNonAdapterDeployflag selects non-adapter snapshots for deployments without the adapter, in the default render mode.Verification:
test-start-turbo,test-dev-turboandtest-start-webpackpass with no snapshot changes.