Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: fix version-staleness test #76020

Merged
merged 1 commit into from
Feb 13, 2025

Conversation

devjiwonchoi
Copy link
Member

@devjiwonchoi devjiwonchoi commented Feb 13, 2025

The test failed since #75882 was merged with a lot of test changes, but #75768 didn't rebase.

@ijjk ijjk added created-by: Next.js team PRs by the Next.js team. tests labels Feb 13, 2025
Copy link
Member Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@ijjk
Copy link
Member

ijjk commented Feb 13, 2025

Failing test suites

Commit: cc8a1b7

pnpm test-dev test/development/enoent-during-require/index.test.ts

  • ENOENT during require > should show ENOENT error correctly
Expand output

● ENOENT during require › should show ENOENT error correctly

thrown: "Exceeded timeout of 120000 ms for a hook.
Add a timeout value to this test to increase the timeout, if this is a long-running test. See https://jestjs.io/docs/api#testname-fn-timeout."

  252 |   let next: NextInstance | undefined
  253 |   if (!skipped) {
> 254 |     beforeAll(async () => {
      |     ^
  255 |       next = await createNext(options)
  256 |     })
  257 |     afterAll(async () => {

  at beforeAll (lib/e2e-utils/index.ts:254:5)
  at development/enoent-during-require/index.test.ts:5:33
  at Object.describe (development/enoent-during-require/index.test.ts:4:1)

Read more about building and testing Next.js in contributing.md.

pnpm test-dev-turbo test/e2e/app-dir/next-after-app-api-usage/index.test.ts (turbopack)

  • nextjs APIs in after() > request APIs inside after() > cannot be called in a dynamic page
  • nextjs APIs in after() > request APIs inside after() > cannot be called in a prerendered page > with dynamic = "force-static"
Expand output

● nextjs APIs in after() › request APIs inside after() › cannot be called in a dynamic page

expect(received).toContain(expected) // indexOf

Expected substring: "[/request-apis/page-dynamic] nested connection(): error: Error: Route /request-apis/page-dynamic used \"connection\" inside \"after(...)\"."
Received string:    "   Loading config from /tmp/next-install-e00a53e11f6c19bbfef01806616050dfdcae0648cc4c32e6e104d621632f3502/next.config.js
 ○ Compiling /request-apis/page-dynamic ...
 ✓ Compiled /request-apis/page-dynamic in 2.4s
 GET /request-apis/page-dynamic 200 in 2920ms
[/request-apis/page-dynamic] headers(): error: Error: Route /request-apis/page-dynamic used \"headers\" inside \"after(...)\". This is not supported. If you need this data inside an \"after\" callback, use \"headers\" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after

  at <unknown> (../app/request-apis/helpers.js:7:18)
     5 |   after(async () => {
     6 |     try {
  >  7 |       await headers()
       |                  ^
     8 |       console.log(`[${route}] headers(): ok`)
     9 |     } catch (err) {
    10 |       console.error(`[${route}] headers(): error:`, err)
  [/request-apis/page-dynamic] cookies(): error: Error: Route /request-apis/page-dynamic used \"cookies\" inside \"after(...)\". This is not supported. If you need this data inside an \"after\" callback, use \"cookies\" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after
  at <unknown> (../app/request-apis/helpers.js:27:18)
  at <unknown> (../app/request-apis/helpers.js:15:10)
    25 |   after(async () => {
    26 |     try {
  > 27 |       await cookies()
       |                  ^
    28 |       console.log(`[${route}] cookies(): ok`)
    29 |     } catch (err) {
    30 |       console.error(`[${route}] cookies(): error:`, err)
  [/request-apis/page-dynamic] connection(): error: Error: Route /request-apis/page-dynamic used \"connection\" inside \"after(...)\". The `connection()` function is used to indicate the subsequent code must only run when there is an actual Request, but \"after(...)\" executes after the request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after
  at <unknown> (../app/request-apis/helpers.js:47:21)
  at <unknown> (../app/request-apis/helpers.js:35:10)
    45 |   after(async () => {
    46 |     try {
  > 47 |       await connection()
       |                     ^
    48 |       console.log(`[${route}] connection(): ok`)
    49 |     } catch (err) {
    50 |       console.error(`[${route}] connection(): error:`, err)
  [/request-apis/page-dynamic] nested headers(): error: Error: Route /request-apis/page-dynamic used \"headers\" inside \"after(...)\". This is not supported. If you need this data inside an \"after\" callback, use \"headers\" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after
  at <unknown> (../app/request-apis/helpers.js:17:20)
  at <unknown> (../app/request-apis/helpers.js:55:10)
    15 |     after(async () => {
    16 |       try {
  > 17 |         await headers()
       |                    ^
    18 |         console.log(`[${route}] nested headers(): ok`)
    19 |       } catch (err) {
    20 |         console.error(`[${route}] nested headers(): error:`, err)
  [/request-apis/page-dynamic] nested cookies(): error: Error: Route /request-apis/page-dynamic used \"cookies\" inside \"after(...)\". This is not supported. If you need this data inside an \"after\" callback, use \"cookies\" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after
  at <unknown> (../app/request-apis/helpers.js:37:20)
    35 |     after(async () => {
    36 |       try {
  > 37 |         await cookies()
       |                    ^
    38 |         console.log(`[${route}] nested cookies(): ok`)
    39 |       } catch (err) {
    40 |         console.error(`[${route}] nested cookies(): error:`, err)
  "
  at toContain (e2e/app-dir/next-after-app-api-usage/index.test.ts:82:22)
  at fn (lib/next-test-utils.ts:807:20)
  at Object.<anonymous> (e2e/app-dir/next-after-app-api-usage/index.test.ts:53:7)

● nextjs APIs in after() › request APIs inside after() › cannot be called in a prerendered page › with dynamic = "force-static"

expect(received).toContain(expected) // indexOf

Expected substring: "[/request-apis/page-force-static] nested cookies(): error: Error: Route /request-apis/page-force-static used \"cookies\" inside \"after(...)\". This is not supported."
Received string:    " ○ Compiling /request-apis/page-force-static ...
 ✓ Compiled /request-apis/page-force-static in 1012ms
 GET /request-apis/page-force-static 200 in 1136ms
[/request-apis/page-force-static] headers(): error: Error: Route /request-apis/page-force-static used \"headers\" inside \"after(...)\". This is not supported. If you need this data inside an \"after\" callback, use \"headers\" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after

  at <unknown> (../app/request-apis/helpers.js:7:18)
     5 |   after(async () => {
     6 |     try {
  >  7 |       await headers()
       |                  ^
     8 |       console.log(`[${route}] headers(): ok`)
     9 |     } catch (err) {
    10 |       console.error(`[${route}] headers(): error:`, err)
  [/request-apis/page-force-static] cookies(): error: Error: Route /request-apis/page-force-static used \"cookies\" inside \"after(...)\". This is not supported. If you need this data inside an \"after\" callback, use \"cookies\" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after
  at <unknown> (../app/request-apis/helpers.js:27:18)
  at <unknown> (../app/request-apis/helpers.js:15:10)
    25 |   after(async () => {
    26 |     try {
  > 27 |       await cookies()
       |                  ^
    28 |       console.log(`[${route}] cookies(): ok`)
    29 |     } catch (err) {
    30 |       console.error(`[${route}] cookies(): error:`, err)
  [/request-apis/page-force-static] connection(): error: Error: Route /request-apis/page-force-static used \"connection\" inside \"after(...)\". The `connection()` function is used to indicate the subsequent code must only run when there is an actual Request, but \"after(...)\" executes after the request, so this function is not allowed in this scope. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after
  at <unknown> (../app/request-apis/helpers.js:47:21)
  at <unknown> (../app/request-apis/helpers.js:35:10)
    45 |   after(async () => {
    46 |     try {
  > 47 |       await connection()
       |                     ^
    48 |       console.log(`[${route}] connection(): ok`)
    49 |     } catch (err) {
    50 |       console.error(`[${route}] connection(): error:`, err)
  [/request-apis/page-force-static] nested headers(): error: Error: Route /request-apis/page-force-static used \"headers\" inside \"after(...)\". This is not supported. If you need this data inside an \"after\" callback, use \"headers\" outside of the callback. See more info here: https://nextjs.org/docs/canary/app/api-reference/functions/after
  at <unknown> (../app/request-apis/helpers.js:17:20)
  at <unknown> (../app/request-apis/helpers.js:55:10)
    15 |     after(async () => {
    16 |       try {
  > 17 |         await headers()
       |                    ^
    18 |         console.log(`[${route}] nested headers(): ok`)
    19 |       } catch (err) {
    20 |         console.error(`[${route}] nested headers(): error:`, err)
  "
  at toContain (e2e/app-dir/next-after-app-api-usage/index.test.ts:119:24)
  at fn (lib/next-test-utils.ts:807:20)
  at e2e/app-dir/next-after-app-api-usage/index.test.ts:100:9

Read more about building and testing Next.js in contributing.md.

pnpm test-dev test/e2e/persistent-caching/persistent-caching.test.ts

  • persistent-caching > should persistent cache loaders
Expand output

● persistent-caching › should persistent cache loaders

expect(received).toBe(expected) // Object.is equality

Expected: "Timestamp = 1739476026742"
Received: "Timestamp = 1739476046886"

  55 |       const browser = await next.browser('/pages')
  56 |       // TODO Persistent Caching for webpack dev server is broken
> 57 |       expect(await browser.elementByCss('main').text()).toBe(pagesTimestamp)
     |                                                         ^
  58 |       await browser.close()
  59 |     }
  60 |   })

  at Object.toBe (e2e/persistent-caching/persistent-caching.test.ts:57:57)

Read more about building and testing Next.js in contributing.md.

@ijjk
Copy link
Member

ijjk commented Feb 13, 2025

Stats from current PR

Default Build
General
vercel/next.js canary vercel/next.js 02-14-ci_fix_version-staleness_test Change
buildDuration 25.3s 26s ⚠️ +747ms
buildDurationCached 22.1s 18.3s N/A
nodeModulesSize 393 MB 393 MB
nextStartRea..uration (ms) 775ms 777ms N/A
Client Bundles (main, webpack)
vercel/next.js canary vercel/next.js 02-14-ci_fix_version-staleness_test Change
5271-HASH.js gzip 55.4 kB 55.4 kB N/A
6228c9d4-HASH.js gzip 56.9 kB 56.9 kB N/A
7048.HASH.js gzip 168 B 168 B
8377-HASH.js gzip 5.46 kB 5.46 kB N/A
framework-HASH.js gzip 57.5 kB 57.5 kB N/A
main-app-HASH.js gzip 245 B 245 B
main-HASH.js gzip 34.9 kB 34.9 kB N/A
webpack-HASH.js gzip 1.71 kB 1.71 kB
Overall change 2.12 kB 2.12 kB
Legacy Client Bundles (polyfills)
vercel/next.js canary vercel/next.js 02-14-ci_fix_version-staleness_test Change
polyfills-HASH.js gzip 39.4 kB 39.4 kB
Overall change 39.4 kB 39.4 kB
Client Pages
vercel/next.js canary vercel/next.js 02-14-ci_fix_version-staleness_test Change
_app-HASH.js gzip 194 B 194 B
_error-HASH.js gzip 193 B 192 B N/A
amp-HASH.js gzip 513 B 511 B N/A
css-HASH.js gzip 342 B 342 B
dynamic-HASH.js gzip 1.84 kB 1.84 kB N/A
edge-ssr-HASH.js gzip 265 B 264 B N/A
head-HASH.js gzip 363 B 360 B N/A
hooks-HASH.js gzip 393 B 390 B N/A
image-HASH.js gzip 4.59 kB 4.59 kB N/A
index-HASH.js gzip 268 B 266 B N/A
link-HASH.js gzip 2.35 kB 2.35 kB
routerDirect..HASH.js gzip 328 B 326 B N/A
script-HASH.js gzip 397 B 397 B
withRouter-HASH.js gzip 325 B 325 B
1afbb74e6ecf..834.css gzip 106 B 106 B
Overall change 3.72 kB 3.72 kB
Client Build Manifests
vercel/next.js canary vercel/next.js 02-14-ci_fix_version-staleness_test Change
_buildManifest.js gzip 749 B 747 B N/A
Overall change 0 B 0 B
Rendered Page Sizes
vercel/next.js canary vercel/next.js 02-14-ci_fix_version-staleness_test Change
index.html gzip 523 B 522 B N/A
link.html gzip 539 B 536 B N/A
withRouter.html gzip 519 B 517 B N/A
Overall change 0 B 0 B
Edge SSR bundle Size
vercel/next.js canary vercel/next.js 02-14-ci_fix_version-staleness_test Change
edge-ssr.js gzip 130 kB 130 kB N/A
page.js gzip 214 kB 214 kB N/A
Overall change 0 B 0 B
Middleware size
vercel/next.js canary vercel/next.js 02-14-ci_fix_version-staleness_test Change
middleware-b..fest.js gzip 677 B 673 B N/A
middleware-r..fest.js gzip 155 B 156 B N/A
middleware.js gzip 31.6 kB 31.6 kB N/A
edge-runtime..pack.js gzip 844 B 844 B
Overall change 844 B 844 B
Next Runtimes
vercel/next.js canary vercel/next.js 02-14-ci_fix_version-staleness_test Change
app-page-exp...dev.js gzip 395 kB 395 kB
app-page-exp..prod.js gzip 133 kB 133 kB
app-page-tur..prod.js gzip 145 kB 145 kB
app-page-tur..prod.js gzip 141 kB 141 kB
app-page.run...dev.js gzip 382 kB 382 kB
app-page.run..prod.js gzip 129 kB 129 kB
app-route-ex...dev.js gzip 39.4 kB 39.4 kB
app-route-ex..prod.js gzip 25.7 kB 25.7 kB
app-route-tu..prod.js gzip 25.7 kB 25.7 kB
app-route-tu..prod.js gzip 25.5 kB 25.5 kB
app-route.ru...dev.js gzip 41 kB 41 kB
app-route.ru..prod.js gzip 25.5 kB 25.5 kB
dist_client_...dev.js gzip 356 B 356 B
dist_client_...dev.js gzip 349 B 349 B
pages-api-tu..prod.js gzip 9.72 kB 9.72 kB
pages-api.ru...dev.js gzip 11.8 kB 11.8 kB
pages-api.ru..prod.js gzip 9.72 kB 9.72 kB
pages-turbo...prod.js gzip 22 kB 22 kB
pages.runtim...dev.js gzip 31.6 kB 31.6 kB
pages.runtim..prod.js gzip 22 kB 22 kB
server.runti..prod.js gzip 61.2 kB 61.2 kB
Overall change 1.68 MB 1.68 MB
build cache
vercel/next.js canary vercel/next.js 02-14-ci_fix_version-staleness_test Change
0.pack gzip 2.12 MB 2.12 MB N/A
index.pack gzip 76.9 kB 76.4 kB N/A
Overall change 0 B 0 B
Diff details
Diff for 5271-HASH.js

Diff too large to display

Diff for main-HASH.js

Diff too large to display

Commit: cc8a1b7

@devjiwonchoi devjiwonchoi marked this pull request as ready for review February 13, 2025 20:03
@devjiwonchoi devjiwonchoi enabled auto-merge (squash) February 13, 2025 20:04
@devjiwonchoi devjiwonchoi merged commit 959a312 into canary Feb 13, 2025
132 checks passed
@devjiwonchoi devjiwonchoi deleted the 02-14-ci_fix_version-staleness_test branch February 13, 2025 20:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
created-by: Next.js team PRs by the Next.js team. tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants