-
Notifications
You must be signed in to change notification settings - Fork 26.7k
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
Speed up createNext test suite isolation #64909
Speed up createNext test suite isolation #64909
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @timneutkens and the rest of your teammates on Graphite |
Removed dependencies detected. Learn more about Socket for GitHub ↗︎ 🚮 Removed packages: npm/next@14.2.1 |
Failing test suitesCommit: 93a4d38
Expand output● app dir › Loading › should render loading.js in initial html for slow page
Read more about building and testing Next.js in contributing.md. |
Tests Passed |
@@ -25,6 +25,6 @@ | |||
"fontkit": "2.0.2" | |||
}, | |||
"peerDependencies": { | |||
"next": "*" | |||
"next": "14.3.0-canary.15" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This was causing another version of Next.js to be installed, i.e. 14.2.1 and as such caused conflicts and sometimes resolved to the older version incorrectly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice PR!
Co-authored-by: JJ Kasper <jj@jjsweb.site>
Seems this was incorrectly referencing the wrong instance. x-ref: #64909 x-ref: https://github.com/vercel/next.js/actions/runs/8806556249/job/24171671288?pr=64691#step:7:839 Closes NEXT-3210
What?
Before: 25.71s
After: 11.05s (-57%)
How?
Currently the system for isolation looks like this:
packages
folder to an isolated directorypnpm pack
for all folders inpackages
dependencies
in package.json of the isolated applicationpnpm install
Because the
next-swc
(Turbopack + SWC, yes we still need to rename the package) binary file is quite large in development (900MB+) it means we have to copy, then zip (pnpm pack), then unzip (pnpm install) that binary, which takes about 3+ seconds in each step.The change in this PR is to skip the copy/zip/unzip completely by providing the folder path for the binary directly to Next.js, as it's a binary we don't need the special isolation for this, it's already standalone so running it directly allows us to skip 14,6 seconds of work that is required for each isolated test in development.
This will likely have little effect on CI times as we already do some tricks like only running the packing at the start of the CI process. Only thing that could be better and is probably worth doing is adopting this change for the time it saves for unzipping, that's almost 4 seconds per test still.
Closes NEXT-3200