Skip to content

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

Open
anthonyshew wants to merge 3 commits intomainfrom
shew/hanging-test
Open

fix: Pre-warm corepack cache to prevent yarn/pnpm tests from hanging#12099
anthonyshew wants to merge 3 commits intomainfrom
shew/hanging-test

Conversation

@anthonyshew
Copy link
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
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

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
Contributor

github-actions bot commented Mar 2, 2026

Coverage Report

Metric Coverage
Lines 83.79%
Functions 79.69%
Branches 0.00%

View full report

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