Skip to content

test: enable compatible body-size cases in deploy - #98911

Merged
jamiboym merged 1 commit into
jamiboym/deploy-exclusion-reasons/process-controlfrom
jamiboym/investigate-deploy/body-size
Sep 29, 2026
Merged

jamiboym merged 1 commit into
jamiboym/deploy-exclusion-reasons/process-controlfrom
jamiboym/investigate-deploy/body-size

Conversation

@jamiboym

@jamiboym jamiboym commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Based on #99392. Stack: #99012 → #98994 → #99392 → #98911. This PR now contains its own skipDeployment → @force-gate conversions and removal of skipped returns, with no dependency on Josh’s migration PRs. Enable only the two body-size tests confirmed passing in both deployment CI variants: a 4 MiB request with a 5 MiB Next.js buffer and a 1 MiB request with a 2 MiB buffer.

Keep the other seven tests gated and replace the migration TODOs with verified reasons:

  • The test deployment enforces the documented 4.5 MB Vercel payload limit. Requests of 5, 6, 10, 11, 20, and 51 MiB receive HTTP 413, independently of the Next.js buffering setting.
  • The 3 MiB request is accepted, but Vercel forwards the entire body instead of applying Next.js's local 2 MiB truncation.

The 5 MiB and 2 MiB suite gates are narrowed to their failing over-limit tests. All test bodies and assertions are unchanged. The redundant dev-only image exclusion is handled separately in #98908.

Verification

@github-actions

github-actions Bot commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Tests Passed

Commit: a4430f5

@jamiboym jamiboym changed the title test: investigate body-size behavior in deploy test: enable compatible body-size cases in deploy Sep 21, 2026
@jamiboym
jamiboym force-pushed the jamiboym/investigate-deploy/body-size branch from 26b28ca to 11d271d Compare September 21, 2026 20:17
@jamiboym
jamiboym changed the base branch from canary to jstory/deploy-tests/pages-router September 21, 2026 20:18
@jamiboym
jamiboym marked this pull request as ready for review September 21, 2026 20:26
@jamiboym
jamiboym requested a review from gnoff September 22, 2026 02:13
@jamiboym
jamiboym force-pushed the jamiboym/investigate-deploy/body-size branch from 11d271d to 448a80a Compare September 23, 2026 03:48
@jamiboym
jamiboym changed the base branch from jstory/deploy-tests/pages-router to jamiboym/deploy-exclusion-reasons/custom-servers September 23, 2026 03:49
@jamiboym
jamiboym added this pull request to stack #99079 September 23, 2026 03:49
jamiboym added a commit that referenced this pull request Sep 24, 2026
Exercise `captureRuntimeLogs` on the suites whose exclusions are plausibly
just "the log is not observable on a deployment": unhandled-rejection logging,
edge response errors, edge streaming errors, and instrumentation under src.
Replace `skipDeployment` with capture, drop the empty-suite returns, and poll
the positive log assertions that previously assumed synchronous delivery.

Three suites from the first attempt are deliberately left excluded, because
they fail for reasons no amount of log collection fixes:

- client-max-body-size: Vercel returns 413 above its own 4.5 MB payload limit
  regardless of the Next.js buffer, and forwards a 3 MiB body without applying
  the local 2 MiB truncation. #98911 already gates the seven affected cases
  individually, with reproductions.
- custom-cache-handler-image: Vercel serves `/_next/image` through its own
  optimizer, so the custom handler never runs and the log never exists.
- instrumentation-hook/register-once: `toIncludeRepeated('register-log', 1)`
  is a per-process invariant, and deploy aggregates logs across serverless
  instances that each register once.

This is still an experiment. The exact-count assertion in unhandled-rejection
logging is the one most likely to expose a gap in the collector's row
deduplication rather than a platform difference.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@jamiboym
jamiboym force-pushed the jamiboym/investigate-deploy/body-size branch from 448a80a to b44c3f0 Compare September 28, 2026 14:42
@jamiboym
jamiboym removed this pull request from stack #99079 September 28, 2026 14:45
@jamiboym
jamiboym added this pull request to stack #99364 September 28, 2026 14:45
@jamiboym
jamiboym force-pushed the jamiboym/investigate-deploy/body-size branch from b44c3f0 to 83082e8 Compare September 28, 2026 15:13
@jamiboym
jamiboym force-pushed the jamiboym/investigate-deploy/body-size branch from 83082e8 to a16d867 Compare September 28, 2026 19:52
@jamiboym
jamiboym force-pushed the jamiboym/investigate-deploy/body-size branch from a16d867 to d988fa4 Compare September 29, 2026 00:31
@jamiboym
jamiboym removed this pull request from stack #99364 September 29, 2026 00:34
@jamiboym
jamiboym changed the base branch from jamiboym/deploy-exclusion-reasons/custom-servers to jamiboym/deploy-exclusion-reasons/process-control September 29, 2026 00:34
@jamiboym
jamiboym added this pull request to stack #99393 September 29, 2026 00:34
jamiboym added a commit that referenced this pull request Sep 29, 2026
Exercise `captureRuntimeLogs` on the suites whose exclusions are plausibly
just "the log is not observable on a deployment": unhandled-rejection logging,
edge response errors, edge streaming errors, and instrumentation under src.
Replace `skipDeployment` with capture, drop the empty-suite returns, and poll
the positive log assertions that previously assumed synchronous delivery.

Three suites from the first attempt are deliberately left excluded, because
they fail for reasons no amount of log collection fixes:

- client-max-body-size: Vercel returns 413 above its own 4.5 MB payload limit
  regardless of the Next.js buffer, and forwards a 3 MiB body without applying
  the local 2 MiB truncation. #98911 already gates the seven affected cases
  individually, with reproductions.
- custom-cache-handler-image: Vercel serves `/_next/image` through its own
  optimizer, so the custom handler never runs and the log never exists.
- instrumentation-hook/register-once: `toIncludeRepeated('register-log', 1)`
  is a per-process invariant, and deploy aggregates logs across serverless
  instances that each register once.

This is still an experiment. The exact-count assertion in unhandled-rejection
logging is the one most likely to expose a gap in the collector's row
deduplication rather than a platform difference.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@jamiboym
jamiboym force-pushed the jamiboym/investigate-deploy/body-size branch from d988fa4 to acaf609 Compare September 29, 2026 16:07
jamiboym added a commit that referenced this pull request Sep 29, 2026
## Summary

Custom-server suites depend on local server entrypoints that deploy mode
does not launch. Replace their legacy `skipDeployment` exclusions and
`skipped` returns with `@force-gate !deploy` and explain the dependency,
while preserving their existing local mode restrictions and assertions.

This covers six test files, including the custom-server sections of API
body parsing and OpenTelemetry. The ordinary API JSON body-parser case
remains enabled in deploy mode; only the Express pre-parsing cases are
excluded. The custom-server shutdown suite also requires the runner to
signal its server process and observe `after()` completion.

Stack: #99012 → #98994 → #99392 → #98911. Based on #99012; #99392
separately explains local process-control exclusions.

## Verification

- The two added suites passed in both webpack development and production
modes: five tests in each mode.
- Collection with the real gate runtime and fixture setup stubbed
confirmed all five tests enabled locally, and only the ordinary API
body-parser test enabled in deploy mode. Both parameterized shutdown
signals are excluded in deploy.
- All 24 gate-transform tests passed. Formatting and ESLint passed for
the added files.
- The JavaScript workspace build passed. The full bootstrap build failed
in the native Rust step (`cargo metadata failed to run`).
- No new deployment was created. The ordinary API body-parser case
passed in the earlier deployment experiment.

<!-- NEXT_JS_LLM -->
@jamiboym
jamiboym force-pushed the jamiboym/investigate-deploy/body-size branch from acaf609 to a4430f5 Compare September 29, 2026 19:52
@jamiboym
jamiboym merged commit 0abfbcb into canary Sep 29, 2026
220 of 222 checks passed
@jamiboym
jamiboym deleted the jamiboym/investigate-deploy/body-size branch September 29, 2026 23:35
jamiboym added a commit that referenced this pull request Sep 29, 2026
## Summary

Retain the deployment exclusions for two suites that require control of
the local Node.js process, replacing legacy `skipDeployment` handling
with explicit `@force-gate !deploy` directives:

- `graceful-shutdown-next-after/next-start` starts a fresh Next.js
process, sends `SIGINT` and `SIGTERM`, and checks whether `after()`
callbacks finish before it exits. Vercel manages the deployed process
lifecycle; the deploy test runner cannot send those signals to that
process or deterministically observe its shutdown. This does not imply
that Vercel lacks graceful shutdown support.
- `node-cli-args` invokes Node with `--experimental-network-inspection`
and checks whether that invocation starts successfully on the current
Node version. Deploy mode does not execute the test's local
`startCommand`, so it cannot exercise Node's handling of that CLI flag.

Preserve all test bodies, including the different development/production
shutdown expectations and the Node 20 rejection case.

Based on #98994, with #98911 above this PR.

## Verification

- The shutdown assertions passed in webpack development and production
modes (both signals in each mode).
- The Node CLI test passed in both modes with normal isolated
installation on Node 26.10.0. An initial `NEXT_SKIP_ISOLATE=1` run could
not resolve its required fixture-local `node_modules/next`; using the
normal fixture installation resolved that validation setup issue.
- Collection with the real gate runtime and fixture setup stubbed
confirmed all three assertions enabled in dev/start and all three
skipped in deploy. A syntax-tree comparison confirmed the test
definitions and assertions are unchanged.
- Formatting and ESLint passed. All 24 gate-transform tests passed on
the same base.
- The JavaScript workspace build passed. Full bootstrap remains blocked
in the native Rust step (`cargo metadata failed to run`). Deploy
execution was not run; local collection verifies the exclusions without
deployment.

<!-- NEXT_JS_LLM -->
jamiboym added a commit that referenced this pull request Oct 1, 2026
## Summary

Migrate the remaining Pages Router, API route, i18n, custom route,
rewrite, redirect, and error-page deployment exclusions to `@force-gate`
and remove their `skipDeployment`/`skipped` control flow. This stack is
rooted at canary and independent of #98430; it preserves deployment
coverage already enabled on canary.

The custom-app-render and client-max-body-size files covered by #98994
and #98911 are omitted.

## Verification

- Compared test registration against canary in development, production,
and deploy modes with test bodies and hooks disabled (Webpack). Existing
active deployment assertions are preserved; development/production test
selection is unchanged apart from replacing empty skip placeholders with
skipped real tests.
- TypeScript, Prettier, and ESLint checks passed. Registration probes
use a default config for lazy predicates and do not exercise fixture
setup or test bodies.
- Full bootstrap attempted, but the local native SWC build fails at
`cargo metadata` with `EPERM`; full integration/deployment execution
remains for CI.

<!-- NEXT_JS_LLM -->

---------

Co-authored-by: Jamiboy Mohammad <jamiboym@gmail.com>
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Oct 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants