Skip to content

fix: Pre-warm corepack cache to prevent yarn/pnpm tests from hanging#12099

Merged
anthonyshew merged 3 commits into
mainfrom
shew/hanging-test
Mar 2, 2026
Merged

fix: Pre-warm corepack cache to prevent yarn/pnpm tests from hanging#12099
anthonyshew merged 3 commits into
mainfrom
shew/hanging-test

Conversation

@anthonyshew
Copy link
Copy Markdown
Contributor

Summary

  • Previous fixes (fix: Prevent yarn integration tests from hanging on corepack prompts #12090, fix: Prevent lockfile-aware yarn test from hanging on corepack downloads #12095) set COREPACK_ENABLE_DOWNLOAD_PROMPT=0 and COREPACK_ENABLE_STRICT=0 to 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 like test_single_package_build_yarn to exceed the 240s timeout.
  • Adds corepack prepare <pm>@<version> --activate during test setup so the exact declared version is cached locally before any test invokes it. This covers both setup_integration_test and setup_lockfile_test paths, fixing the hang for all PM-based integration tests.
  • Removes the COREPACK_ENABLE_STRICT=0 workaround 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_yarn and test_lockfile_aware_caching_yarn tests should no longer hang or appear as SLOW in CI.

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.
@anthonyshew anthonyshew requested a review from a team as a code owner March 2, 2026 07:57
@anthonyshew anthonyshew requested review from tknickman and removed request for a team March 2, 2026 07:57
@vercel
Copy link
Copy Markdown
Contributor

vercel Bot commented Mar 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
examples-basic-web Ready Ready Preview, Comment, Open in v0 Mar 2, 2026 8:17am
examples-designsystem-docs Ready Ready Preview, Comment, Open in v0 Mar 2, 2026 8:17am
examples-gatsby-web Ready Ready Preview, Comment, Open in v0 Mar 2, 2026 8:17am
examples-kitchensink-blog Ready Ready Preview, Comment, Open in v0 Mar 2, 2026 8:17am
examples-nonmonorepo Ready Ready Preview, Comment, Open in v0 Mar 2, 2026 8:17am
examples-svelte-web Ready Ready Preview, Comment, Open in v0 Mar 2, 2026 8:17am
examples-tailwind-web Ready Ready Preview, Comment, Open in v0 Mar 2, 2026 8:17am
examples-vite-web Ready Ready Preview, Comment, Open in v0 Mar 2, 2026 8:17am
turbo-site Ready Ready Preview, Comment, Open in v0 Mar 2, 2026 8:17am
turborepo-agents Ready Ready Preview, Comment, Open in v0 Mar 2, 2026 8:17am
turborepo-test-coverage Ready Ready Preview, Comment, Open in v0 Mar 2, 2026 8:17am

Comment thread crates/turborepo/tests/common/setup.rs
Comment thread crates/turborepo/tests/common/setup.rs
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.
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Mar 2, 2026

Coverage Report

Metric Coverage
Lines 83.79%
Functions 79.69%
Branches 0.00%

View full report

@anthonyshew anthonyshew merged commit caaf6b8 into main Mar 2, 2026
79 of 81 checks passed
@anthonyshew anthonyshew deleted the shew/hanging-test branch March 2, 2026 15:16
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant