Repository navigation
Conversation
…temporary directory Each analyze-pr run in "sizes a component whose bundle reaches a changed shared module" bundles with esbuild, which reads the listing of every directory above the files it bundles. The fixture and analyze-pr's scratch files lived in the system temporary directory, so every build listed it. On a shared machine it held 272,514 entries, and under load the test ran past its 30 s limit, though it passes alone in about 2 s. The fixture and the scratch directory (TMPDIR for the analyze-pr runs it starts) now live under the checkout's node_modules/.cache/analyze-pr-test. On two cores shared with 20 busy processes the test ran 34.2 to 43.9 s before (5 of 5 timed out) and 12.5 to 19.4 s after (7 of 7 passed). No timeout, retry or skip changes; analyze-pr.js is unchanged.
|
Deployment failed for project astryx with the following error: |
|
AI review status for this pull request.
|
PR Analysis Report
Generated by PR Enrichment workflow | View current CI run |
There was a problem hiding this comment.
This looks ready to approve. Moving the reach test's fixture and its analyze-pr scratch files under node_modules/.cache keeps every esbuild build out of the system temporary directory, and the test's assertions are unchanged. With 272,514 entries in the temporary directory, the reach test took about 1.17 s before and 0.52 s after (the same as with an empty one), and every test in the file passes. The file's remaining os.tmpdir() fixtures can follow once #9164 lands.
[Automated review]
…temporary directory (re-land of #9209) (#9212) test(analyze-pr): the reach test keeps its fixture out of the system temporary directory (re-land of #9209) Co-authored-by: vjeux <[email protected]>
Maintainer impact
On a busy shared machine,
analyze-pr.test.mjs's "sizes a component whose bundle reaches a changed shared module" runs past its 30 s limit and fails, though it passes alone in about 2 s. A localpnpm test:nodegate then reads red for changes that never touched the analysis.Intended invariant
The test checks the same analysis with the same fixture and the same four analyze-pr runs. Only where the fixture and analyze-pr's scratch files live changes;
analyze-pr.jsis untouched.Change
Each analyze-pr run here bundles with esbuild (twice when the fixture has a build), and esbuild reads the listing of every directory above a file it bundles. The fixture lived in the system temporary directory, and so did analyze-pr's scratch files, so every build listed it. On a shared machine that directory held 272,514 entries, which cost each run about 0.5 to 0.7 s more, rising with load.
The test now creates its fixture, and a scratch directory it passes as
TMPDIRto the analyze-pr runs it starts, under the checkout'snode_modules/.cache/analyze-pr-test(asscripts/motion-node-load.test.mjsdoes withnode_modules/.cache). No build reads the temporary directory any more. No timeout, retry or skip changes.Other tests in this file make their fixtures the same way. #9164 edits several of them, so this pull request leaves them for after it.
Evidence
Scope
Testing
pnpm exec vitest run --project node .github/scripts/analyze-pr.test.mjs: 11 of 11 pass.tasksetto two cores, with 20node -e 'for(;;){}'processes pinned to the same cores; runs before and after the change interleaved..github/scriptstests pass (1,598); the UI suite passes (17,099 tests); the node suite passes except the twocache.test.mjslock tests that fail on this machine without the change too (fix(cli): a crashed run's release install is recognized by the Node it ran on, whatever its name #8520), and the reach test took 1.1 s inside it.