Repository navigation
test(cli): load stored doc reference exports natively under contention - #11909
astracat-bot[bot] wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
AI review status for this pull request.
|
There was a problem hiding this comment.
Approved pending CI: the node test shards are still queued or running on this head.
Routing the stored-doc export test's reference imports through the existing importUrl helper keeps the corpus, every assertion and the timeout, and removes the per-doc wait on Vitest's main process. There are no blocking findings. In a nine-worker reproduction each export check took about 10.5 s before this change and about 0.25 s after it.
Claims and files checked
Review mode: full; reason: no-earlier-review
- The test imports more than 1,500 doc modules with a
?nativequery: verified (stored-docs.test.mjs:128,:132). - An import made from the transformed test goes through Vitest's main process: verified (
vitest.config.ts:224-228; nine contending workers took about 10.5 s per check before the change and about 0.25 s after it). - The
import-url.mjshelper already exists and the node project loads it natively: verified (foundation/fs/import-url.mjs:21-23,vitest.config.ts:234, both unchanged). - The module URL, corpus, assertions, minimum checked count and timeout are unchanged: verified (
stored-docs.test.mjs:121-132,vitest.config.ts:246). - No behavior, production code, workflow, timeout, retry or baseline change: verified (one test file, 3 lines added and 1 removed).
- Vitest 4.1.11 gives a test timeout the stack captured where the test was registered: verified (the lockfile pins 4.1.11, and its runner builds the timeout error from the registration stack).
- The doc-compiler suite passes 326 tests across 13 files: verified (13 files, 326 passed on this head).
- With 24 contending cold-import copies, every export check timed out at 30 s before the change and passed in 414 to 500 ms after it (168 of 168 tests): consistent, though not repeated at 24 workers (at nine workers, about 10.5 s per check on the base and 0.25 to 0.32 s on this head).
- Prettier passes on the changed file: verified (ESLint is clean too).
- The run used the pinned pnpm 11.10.0: verified (
package.json:153); the Node version is the author's environment. - The test was rescued five times in a week, and a hosted reproduction could not start: not checkable from the repository; not relied on.
- The spec lookup and the pre-review report were run and found nothing: not rerun here (they need the author's checkout); this review's own spec lookup found only testing claims that the change preserves.
- No public API, product behavior, visual or policy change: verified.
- The public text carries no internal context: verified (title, description, branch, commit message and added lines).
packages/cli/foundation/doc-compiler/stored-docs.test.mjs: clear.
PR Analysis Report🔎 Preview ·
|
|
(Posted by Cindy's agent.) Closing in favor of #12116, a byte-identical copy of this change that keeps your credit as co-author. That copy goes through the normal merge path. |
validation: ran pnpm test:node packages/cli/foundation/doc-compiler/stored-docs --maxWorkers=24 --reporter=verbose with 24 isolated, cold-import copies of the spec, 168/168 tests passed; pnpm test:node packages/cli/foundation/doc-compiler --maxWorkers=4 --reporter=verbose, 326/326 tests passed across 13 files; Prettier and the pre-review report passed.
Maintainer impact
The stored-doc export equivalence test intermittently times out under import contention. Its newest rescued attempt was at a2b5fe4. Vitest 4.1.11 assigns the collected
STACK_TRACE_ERRORstack to timeout errors, which explains the otherwise uninformative failure at the test's registration line.The test directly imports more than 1,500 doc modules with a
?nativequery. Despite the query's name, an import from the transformed test still goes through Vitest's main process. The queued requests can consume the entire 30-second test budget.Intended invariant
Every stored doc must equal the exports Node imports from that doc. Keep the complete corpus, each equality assertion, the minimum checked count, and the existing timeout.
Change
Use the existing
foundation/fs/import-url.mjshelper for this test's reference import. The Node project already loads that helper natively. This removes per-doc requests to the runner without changing the module URL or the assertions.No behavior change. No production code, workflow, timeout, retry, or baseline changes.
Evidence
The stress command sets
VITEST_MAX_WORKERS=24 VITEST_MAX_THREADS=24 VITEST_MAX_FORKS=24beforepnpm test:node, in addition to--maxWorkers=24. Its before run also filters to--testNamePattern='hold, for every stored doc, the exports an import of it gives'.Scope
Affected test:
packages/cli/foundation/doc-compiler/stored-docs.test.mjs › stored doc exports › hold, for every stored doc, the exports an import of it gives.Only the test's reference import changes. The CI trace does not name the exact doc being loaded when its deadline expired, so the reproduction deliberately stresses the import queue rather than assuming one particular doc is faulty. Retaining the direct transformed import was the alternative, but it keeps the unnecessary runner contention.
Testing
Node 24.22.1 and the pinned pnpm 11.10.0.
pnpm specs:forwas run before editing and against the final diff.pnpm review:prereported zero findings and a clean merge.pnpm exec prettier --check packages/cli/foundation/doc-compiler/stored-docs.test.mjspassed.