Repository navigation
test(cli): packed-docs-routes starts no background Core download - #13634
Conversation
hookMiss runs the packed CLI without CI set. Outside CI, a global copy starts a detached download of its own Core as the run exits. That download writes into the test's cache folder after the run, while afterAll removes the folder, so the removal can fail with ENOTEMPTY. Set CI in the run's environment, as packed-help-imports.test.mjs does. GitHub Actions sets CI, so CI runs already skip the download.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
|
/approve-spec dffd72a |
PR Analysis Report🔎 Preview ·
|
There was a problem hiding this comment.
Approved pending CI: CI has not run on this head yet because the pull request is a draft, and it runs once the pull request is marked ready for review.
Setting CI for hookMiss's runs is the right fix, since maybeFetchCore checks only CI and NO_UPDATE_NOTIFIER turns off only the update check (global-mode spec FR6). A copy of the old test showed the tarball run's detached Core worker writing into the test cache after that run had exited; with CI set, no worker starts and all four tests still pass.
Claims and files checked
Review mode: full; reason: no-earlier-review
- Claim: a local run without
CIcan fail inafterAllwithENOTEMPTYor leave files behind, and CI runs are not affected. Verified: a copy of the old test shows a detached worker writing into the test cache 750 ms after the tarball run exits; GitHub Actions setsCIand no workflow overrides it. - Claim: the unpacked tarball copy counts as a global copy because the owner of its folder has no
package.json. Verified:foundation/release/choose.mjs:373-385, test lines 42-50. - Claim: a global copy starts a detached Core download as its run exits. Verified:
foundation/release/handoff.mjs:241-247,foundation/release/global-state.mjs:325-360and:427-435. - Claim:
CIstops that download andNO_UPDATE_NOTIFIERdoes not. Verified:global-state.mjs:332against:383. - Claim: the test points the cache at its own folder, so the download writes there. Verified: test line 114,
foundation/env/user-dirs.mjs:62-65. - Claim:
packed-help-imports.test.mjsalready setsCIfor its runs. Verified: line 98. - Claim: the change only adds
CIbesideNO_UPDATE_NOTIFIER, changes no product code and needs no changeset. Verified: one test file, 3 added lines (test lines 109-111). - Claim: every run uses
--jsonand the assertions are unchanged. Verified: test line 101; no assertion changes in the diff. - Claim: with
CIset, no worker runs and nothing is written after the runs. Verified: no worker after any run and noreleases/folder in the test cache. - Claim: the changed test passes with
CIunset. Verified: 4 of 4 tests pass. - Claim: Prettier passes on the changed file. Verified.
- Claim: the author's local failure counts (one
ENOTEMPTYin six runs; a write 935 ms after the last run). These are the author's own local observations and were not re-measured; the write after exit that causes them is verified above. - Claim: a full local preflight passes, with all of its test suites. This was not re-run here; CI runs those suites once the draft is ready.
- Claim: no public API, product or policy change, and no internal context in public text. Verified: the diff is test-only, and the title, description, branch and commit text are clean.
- File
packages/cli/test/packed-docs-routes.test.mjs: clear.
cixzhang
left a comment
There was a problem hiding this comment.
Engineering-owner approval at this exact head (dffd72a), posted by Cindy's agent (agent-made, not a human review) under her standing instruction. Test-only change. CodeBunny approved this head, CI is green at this head, and Specs records it as test-only.
…nd Core download (#13639) test(cli): packed-search-catalog's kept-store case starts no background 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.
Maintainer impact
A local run of
packages/cli/test/packed-docs-routes.test.mjscan fail inafterAllwithENOTEMPTY, or leave a folder behind in the temporary directory. It happens only whereCIis not set, as in a localpnpm preflight. GitHub Actions setsCI, so CI runs are not affected.Intended invariant
This test's runs of the packed CLI leave no process that writes into its folders after the run.
packages/cli/test/packed-help-imports.test.mjsalready setsCIfor the runs it starts.Change
hookMissruns the CLI from the unpacked tarball. That copy sits in anode_modulesfolder whose owner holds nopackage.json, so the CLI reads it as a global copy (isGlobalCopy).As a global copy's run exits, it starts a detached download of its own Core into the user cache (
maybeFetchCoreinfoundation/release/global-state.mjs).CIstops that download, andNO_UPDATE_NOTIFIERdoes not.The test points the cache at its own folder, so the download writes there after the run has exited. A write that lands while
afterAllremoves the folder fails the removal.The change sets
CI: '1'besideNO_UPDATE_NOTIFIERin the environment ofhookMiss's runs. No product code changes, so the change has no changeset.Evidence
main's environment waited inafterAllfor background work before it removed its folder. One detachedcore-worker.mjsran for the test's cache. It wroteno-cache/astryx/releases/.failed-0.7.18.json935 ms after the last CLI run had exited. In six earlier local runs of the unchanged test, one failed withENOTEMPTY, and one left that file behind.CIset saw no worker, and nothing was written after the runs. The changed test passed 3 of 3 runs, and only Node's compile cache was left in the run's temporary folder. The same change also passed six earlier local runs, with nothing left.--json, and the test's assertions pass unchanged.CI, so CI runs take the same path as before.Scope
Components: CLI tests
Testing
pnpm build, thenpnpm exec vitest run --project node packages/cli/test/packed-docs-routes.test.mjsthree times withCIunset: 4 of 4 tests pass each time.CIunset and once withCI=1. It is not part of this change.ASTRYX_STRICT_LINT=1 pnpm preflightat the head, from a clean tree: all 8 steps pass, and it reports "ready to flip". Vitest passes 27,363 tests in the ui project and 30,248 in the node project, this test among them.