Unverified Commit 5d764966 authored by Tobias Koppers's avatar Tobias Koppers Committed by GitHub

test: allow custom webpack deployments to complete (#100054)

### What?

Gives the `--custom-webpack` e2e tests that start their own Next.js
instance a 240-second per-test timeout, matching the existing `explicit
application directory` test in the same file. The tests are the
shadowed-webpack test, the missing-webpack error test, and both
conflicting-bundler-flag tests. Test bodies and assertions are
unchanged, and deploy mode keeps running them.

### Why?

`custom-webpack.test.ts` (added in #99234) fails every attempt in Vercel
deploy tests on v16.5.0-canary.7 and canary.8 with `Exceeded timeout of
60000 ms` in `with a shadowed webpack and no pnpm hoisting`:

-
https://github.com/vercel/next.js/actions/runs/38096257736/job/114359133787
-
https://github.com/vercel/next.js/actions/runs/38006180482/job/114077823665

These suites use `skipStart`, so the instance starts inside the test
rather than in setup. In deploy mode, starting means waiting for the
whole Vercel deployment (install, build, deploy; about 60–90 s in these
runs). The e2e harness gives each test 60 s unless the test sets its own
timeout. The shadowed-webpack test is cut off at 60 s while its
deployment is still building. The explicit-application-directory test
passes (61–88 s) only because it already has a longer timeout. The other
three tests pass, but at 45–57 s, close enough to fail next.

### How?

A per-test timeout fits the file's existing convention and keeps
deployment coverage. Skipping in deploy mode would remove the only
deployed check that the app's own webpack is used, and `test/AGENTS.md`
discourages it. Moving the start into `beforeAll` would restructure
these suites, which keep the start inside the test because each test
sets up its own preconditions first. The trade-off is that a real hang
in these tests now fails after up to 4 minutes instead of 1.

### Verification

- Confirmed the root cause against both job logs and the e2e/deploy
harness
- Compared the file's test registrations before and after: same 8 tests
with unchanged bodies, exactly 4 new timeouts, and every test that
starts an instance itself is covered
- `prettier --check` (repo-pinned version) and `git diff --check`
- Not run: eslint / type-check (no workspace dependencies in the
sandbox) and local or deploy e2e (no build outputs or Vercel
credentials). The deploy run still needs to be confirmed in the deploy
test workflow.

<!-- NEXT_JS_LLM -->


<!-- fleet db94cc8e-c6ca-4069-9894-120a370db8c4 -->
Co-authored-by: 's avatarvercel-fleet-prod[bot] <318278635+vercel-fleet-prod[bot]@users.noreply.github.com>
Co-authored-by: 's avatarTobias Koppers <1365881+sokra@users.noreply.github.com>
parent c420af22
......@@ -109,7 +109,7 @@ describe('--custom-webpack with a shadowed webpack and no pnpm hoisting', () =>
expect($('#replacement-message').text()).toBe(
'replaced by NormalModuleReplacementPlugin'
)
})
}, 240_000)
})
// @force-gate webpack
......@@ -211,7 +211,7 @@ describe('--custom-webpack without a webpack dependency', () => {
'`--custom-webpack` requires webpack to be installed in your project'
)
})
})
}, 240_000)
})
// @force-gate webpack
......@@ -248,6 +248,6 @@ for (const conflictingFlag of ['--webpack', '--turbopack']) {
expect(next.cliOutput).toContain('--custom-webpack')
expect(next.cliOutput).toContain(conflictingFlag)
})
})
}, 240_000)
})
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment