fix: Pre-warm corepack cache to prevent yarn/pnpm tests from hanging#12099
Merged
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
|
github-actions Bot
added a commit
that referenced
this pull request
Mar 2, 2026
## Release v2.8.13-canary.11 > [!CAUTION] > Versioned docs aliasing FAILED. [View logs](https://github.com/vercel/turborepo/actions/runs/22582224414) ### Changes - release(turborepo): 2.8.13-canary.10 (#12103) (`0362361`) - perf: Reduce allocations in file hash computation (#12102) (`5a55bbe`) - perf: Replace SWC with oxc for JS/TS parsing (#12098) (`910b557`) - fix: Pre-warm corepack cache to prevent yarn/pnpm tests from hanging (#12099) (`caaf6b8`) --------- Co-authored-by: Turbobot <turbobot@vercel.com>
github-actions Bot
added a commit
that referenced
this pull request
Mar 2, 2026
## Release v2.8.13-canary.12 > [!CAUTION] > Versioned docs aliasing FAILED. [View logs](https://github.com/vercel/turborepo/actions/runs/22584334499) ### Changes - fix: Pre-warm corepack cache to prevent yarn/pnpm tests from hanging (#12099) (`caaf6b8`) - release(turborepo): 2.8.13-canary.11 (#12108) (`5375984`) - perf: Disable unused zstd default features to reduce C compilation (#12107) (`b6e5690`) - perf: Replace `git` subprocess in worktree detection with Rust (#12106) (`0eef739`) --------- Co-authored-by: Turbobot <turbobot@vercel.com>
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.