Skip to content

test(cli): packed-search-catalog's kept-store case starts no background Core download - #13639

Merged
cixzhang merged 1 commit into
mainfrom
test/packed-search-catalog-ci
Nov 23, 2026
Merged

cixzhang merged 1 commit into
mainfrom
test/packed-search-catalog-ci

Conversation

@cixzhang

Copy link
Copy Markdown
Contributor

Who this helps

Anyone who runs the CLI's packed tests outside CI: a contributor running one case, or a lab machine without CI set. One case in packed-search-catalog.test.mjs runs an installed copy of the CLI, which is a global copy, without CI set. Outside CI, a global copy's run starts the background Core step as it exits. That step can still be writing into the case's cache while the test run removes its folders. This is the race #13634 fixed in packed-docs-routes.test.mjs, where it showed as ENOTEMPTY.

What changes

packages/cli/test/packed-search-catalog.test.mjs only. The case "keeps a reference to the store, not a copy, and reads it back byte for byte" now runs with CI: '1', beside its own cache and home. The case does not test the background step.

The case that does test it is unchanged: "starts the global copy's background Core step from the offline registry, never npm, with CI unset". It sets CI: '' on purpose and waits for the step's outcome.

Tests

Red-first, on a Linux build box after pnpm build, with CI unset. The CLI's background Core step was instrumented locally, not in this change, to log each start.

  • Before: running only this case, its run started the step once. The step wrote releases/.failed-0.7.18.json into the case's cache 2.7 s after the test run ended.
  • After: the same run starts no step, and nothing is written after the run ends. The case still passes.
  • Quick preflight: passes (its changed tests include this file).

Siblings checked, with no change needed

The same instrumented run covered the other tests that run a packed or installed CLI: packed-command-list, packed-manifest, packed-self-audit, packed-stored-docs, packed-template-components, the three global-local files, packed-gather-cache (discovery, hosted, records), build.global-copy, build.packed-old-core, doctor theme-checks, render hosted-packages, jiti-cache, build-theme.transpile-cache and test-home. packed-docs-routes ran as a control.

  • No step started:
    • Most never reach the step: the run is not a global copy, or it is hosted.
    • Others return before it starts: Core is beside the CLI or cached, or the version is not a release.
  • The step starts on purpose, and the test waits: global-local G52 waits for the step's outcome. G55 uses its own stand-in step and checks that it started; its folders are removed with retries for a step still writing.
  • packed-docs-routes: CI is already set (test(cli): packed-docs-routes starts no background Core download #13634), and no step starts.

CI impact

CI impact: none. CI already sets CI=true, which this case inherits; the change matters only when CI is unset. Repository tooling only: no Changeset.

Owning session: noopbot (a61f66c2), under CI & Release (ca77f950). Land path: the drain's serial merge loop, on green, CodeBunny approval and Specs' exact-head /approve-spec.

…nd Core download

The case runs an installed copy, a global copy, without CI set, so outside CI its run starts the background Core step. Run alone, that step wrote releases/.failed-0.7.18.json into the case's cache 2.7 s after the test run ended, while the run folder was being removed: the race #13634 fixed in packed-docs-routes. CI: '1' in the case's env keeps the step from starting; the case does not test it. The case that does ('starts the global copy's background Core step ... with CI unset') is unchanged and waits for the step's outcome.
@vercel

vercel Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
astryx Ready Ready Preview Nov 23, 2026 6:41am UTC

Request Review

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Meta Open Source bot. label Nov 23, 2026
@astracat-bot

astracat-bot Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

AI review status for this pull request.

Review status Updated
🟢 Reviewed (for maintainers only) Nov 23, 2026, 7:02 AM UTC

@cixzhang

Copy link
Copy Markdown
Contributor Author

/approve-spec 5cd0dd8

@github-actions

github-actions Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Contributor

PR Analysis Report

🔎 Preview · 5cd0dd8

Storybook · Sandbox · built from this PR's head

Package size: no published package changed; no new dependencies.

Not run on this PR: add ci:run-visual for Visual, ci:run-a11y for Accessibility, ci:run-rtl for RTL.


Generated by PR Enrichment workflow | View full report

@astracat-bot astracat-bot Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved pending CI: CI has not run on this head yet.

Setting CI: '1' keeps the kept-store case's installed CLI from starting the background Core install when the suite runs without CI. With CI unset, the base's case left that step's release lock in its own cache and the head's left nothing, and all 14 cases in the file pass on the head. Nothing needs to change.

Claims and files checked

Review mode: full; reason: no-earlier-review

  • Claim: the kept-store case ran an installed copy, which is a global copy, without CI. Verified: packed-search-catalog.test.mjs:359-385 on the base, pack-published-cli.mjs:35-43, choose.mjs:385.
  • Claim: outside CI, a global copy starts the background Core step as it exits. Verified: handoff.mjs:238-244, global-state.mjs:325-358, and reproduced with CI unset, empty and 0.
  • Claim: the step can still write into the case's cache while the run removes its folders, the race #13634 fixed in packed-docs-routes.test.mjs. Verified: the write lands after the command returns, in the case's cache under the suite's work folder (:87-92); #13634 adds CI: '1' there.
  • Claim: only this test file changes, and the case now runs with CI: '1' beside its own cache and home. Verified: one file, 4 lines added and 1 deleted; :371.
  • Claim: the case does not test the step, and the case that does is unchanged, sets CI: '' and waits for the outcome. Verified: :362-382, :425-452.
  • Claim: before the change the case started the step, which wrote into its cache; after it, no step starts and the case still passes. Verified by a red-first run with CI unset: a release lock in the case's cache on the base, none on the head, and the case passes on both.
  • Claim: the quick preflight passes. Verified in substance: eslint on the file and the whole test file pass on the head; the preflight wrapper itself was not rerun.
  • Claim: the listed sibling tests need no change. Spot-checked: copies without the step (global-local-fixtures.mjs:521, packed-gather-cache-fixture.mjs:564), a seeded cache (:387-423), the stand-in step in G55 (global-local.rows-40-59.test.mjs:841-878), removal with retries (release-fixtures.mjs:43-53), and CI already set in packed-docs-routes.test.mjs:109-111.
  • Claim: no CI impact, since CI already sets CI=true and the case inherits it. Verified: run() spreads process.env first (:100-107), and '1' and 'true' both count as set (update-notice-env.mjs:21-28).
  • Claim: no changeset is needed. Verified: the package's files exclude **/*.test.* (packages/cli/package.json:95).
  • File: packages/cli/test/packed-search-catalog.test.mjs: clear.

Automated review (maintainer link)

@cixzhang
cixzhang marked this pull request as ready for review November 23, 2026 07:11
@cixzhang
cixzhang merged commit 276a2b6 into main Nov 23, 2026
146 checks passed
@github-actions
github-actions Bot deleted the test/packed-search-catalog-ci branch November 24, 2026 06:07

This branch was successfully deployed

1 active deployment
Preview — 5cd0dd83 Deployed Nov 23, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Meta Open Source bot.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant