fix: Pre-warm corepack cache to prevent yarn/pnpm tests from hanging#12099
Open
anthonyshew wants to merge 3 commits intomainfrom
Open
fix: Pre-warm corepack cache to prevent yarn/pnpm tests from hanging#12099anthonyshew wants to merge 3 commits intomainfrom
anthonyshew wants to merge 3 commits intomainfrom
Conversation
Previous fixes (#12090, #12095) set COREPACK_ENABLE_DOWNLOAD_PROMPT=0 and COREPACK_ENABLE_STRICT=0, which prevented interactive prompts but did not stop corepack from downloading PM binaries from the network. On CI with a cold cache, these downloads cause tests to exceed the 240s timeout. Add `corepack prepare <pm>@<version> --activate` during test setup so the exact declared version is cached locally before any test runs. This covers both setup_integration_test and setup_lockfile_test paths.
Contributor
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Corepack only manages yarn and pnpm. Running corepack enable/prepare for bun or npm fails since corepack doesn't support them. Guard both setup_package_manager and prepare_corepack_from_package_json to only invoke corepack for supported PMs. Fixes test_lockfile_aware_caching_bun failure.
npm is managed by corepack. Only bun is unsupported.
Contributor
Coverage Report
|
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
COREPACK_ENABLE_DOWNLOAD_PROMPT=0andCOREPACK_ENABLE_STRICT=0to address hanging yarn tests, but neither flag prevents corepack from downloading PM binaries from the network. On CI with a cold corepack cache, these downloads cause tests liketest_single_package_build_yarnto exceed the 240s timeout.corepack prepare <pm>@<version> --activateduring test setup so the exact declared version is cached locally before any test invokes it. This covers bothsetup_integration_testandsetup_lockfile_testpaths, fixing the hang for all PM-based integration tests.COREPACK_ENABLE_STRICT=0workaround that was based on a misunderstanding of what that flag does (it controls cross-PM enforcement, not version downloading).How to test
The
test_single_package_build_yarnandtest_lockfile_aware_caching_yarntests should no longer hang or appear as SLOW in CI.