Skip to content

[rushstack] Keep integration fixtures in project temp folders - #6185

Merged
Ian Clanton-Thuon (iclanton) merged 4 commits into
microsoft:mainfrom
iclanton:test/project-local-fixtures
Oct 30, 2026
Merged

Ian Clanton-Thuon (iclanton) merged 4 commits into
microsoft:mainfrom
iclanton:test/project-local-fixtures

Conversation

@iclanton

@iclanton Ian Clanton-Thuon (iclanton) commented Oct 30, 2026 •

Copy link
Copy Markdown
Member

Summary

Move the Git/index tests, shared daemon graph fixture, and detached-daemon startup tests into their owning projects' temp directories. Check immutable starting repositories and scripts into source control instead of rebuilding their contents as strings in setup.

Stop deleting these workspaces during test teardown. Preserve daemon shutdown, socket closure, cache disposal, and owned-process joins; let the Heft test phase's --clean step delete the retained files.

This follows #6174 and targets the recurring Windows EBUSY directory-removal failure in the detached restart test, most recently in main run 40986415130.

Details

  • Add checked-in Git repository inputs and Git config for package-deps-hash, plus the baseline three-project graph repository and build scripts for the shared DaemonGraphTestFixture.
  • Copy immutable inputs into independent case directories under the project's temp/test. The startup suite uses the shorter temp/sXXXXXX layout to fit Unix socket paths on CI. Unique case directories isolate simultaneous fixtures and preserve failed outputs for diagnosis. Dynamic setup remains only where necessary: the current Rush version, Git metadata/commits, installation state, and mutations exercised by tests.
  • Configure TypeScript asset copying so fixture data is available next to compiled tests.
  • Add project-level Heft test clean rules for temp/test in the three affected projects, plus the exact temp/s?????? startup-workspace pattern, inheriting their existing rig configuration.
  • Keep all cache disposal, mock restoration, daemon shutdown, cancellation joins, stopped-process assertions, and helper-process joins. Only recursive workspace deletion moves out of teardown.
  • Update graph fixture ownership tests for retention and add regression coverage for immutable source inputs, independent workspaces, project-local physical paths, and host lock release.
  • Keep the client startup workspace name short enough for the listener's temporary Unix socket name.
  • Use the already-declared node-core-library dependency's FileSystem for standard reads/writes, copies, real paths, enumeration, and timestamps in the six touched test/helper files. Buffer reads and strict missing-file deletion errors are preserved. Native APIs remain only where needed for temporary allocation, bigint stats, exact mode/link/directory-removal semantics, or native filesystem interception tests.

Fixture-local attributes pin text to LF, including on Windows checkout. The original graph input.txt bytes intentionally have no final newline. Tests that verify cache restoration and file hashes remain unchanged.

This is the agreed focused first cleanup, not a repository-wide rewrite. Other helpers and test files still use system temp paths; the production socket runtime-path logic is unchanged. File identity precision, graph admission timing, and the delayed-wire race are separate work (#6153 already covers the last of those).

No production behavior, dependencies, assertions about resource ownership, retry logic, or timeout budgets change here. #6183 separately scopes integration test budgets; this PR does not depend on it.

How it was tested

macOS, Node 24.22.2:

  • node common/scripts/install-run-rush.js build --only @rushstack/package-deps-hash --only @rushstack/rush-client-core --only @rushstack/rush-daemon --parallelism 2 — package-deps-hash and daemon passed; client initially hit the 2,000-line lint ceiling. After keeping the test path constant at module scope, the client build and subsequent dependency-ordered build passed without warnings.
  • In libraries/package-deps-hash, rushx _phase:test — passed, 182 passed / 2 skipped. The new Heft test clean rule ran.
  • In libraries/rush-client-core, rushx _phase:build and node ../../apps/heft/lib-commonjs/start.js run --only test -- --test-path-pattern 'connectOrStartDaemon.test' — passed, 81 passed / 4 skipped.
  • In libraries/rush-daemon, rushx _phase:build — passed, including type-check, lint, asset copying, and API Extractor.
  • In libraries/rush-daemon, HOME="$PWD/temp/test-home" node ../../apps/heft/lib-commonjs/start.js run --only test -- --test-path-pattern 'DaemonGraphFixtureSetup|DaemonGraphFixturePaths|DaemonGraphRequestRouter|WorkspaceTransitionAdmission|WorkspaceWarmSet|NativeWorkspacePaths|WorkspaceWatchPolicy' --max-workers 2 — passed, 65 tests across eight suites, including warm-set cache restoration and setup cancellation. The project-local home avoids the developer's Rush user .env. Nested fixture repositories produce informational phantom-node_modules notices from the owning project's node_modules; these do not fail the tests.
  • node common/scripts/install-run-rush.js change --verify --target-branch microsoft/main --no-fetch — passed.
  • Pre-commit Prettier — passed. It only reformatted three fixture manifests.

After the FileSystem migration, the three dependency-ordered builds (including lint/type-check) and the same local suites were repeated successfully: 182 package tests, 81 startup tests, and 65 graph-consumer tests. The pre-commit formatter and change-file verification also passed.

Windows validation on supported Node 24.22.1 completed on commit 3ce23ff961, before the subsequent FileSystem-only refactor:

  • node common/scripts/install-run-rush.js build --only @rushstack/package-deps-hash --only @rushstack/rush-client-core --only @rushstack/rush-daemon --parallelism 2 — passed.
  • In libraries/rush-client-core, node ../../apps/heft/lib-commonjs/start.js run --only test -- --clean --test-path-pattern connectOrStartDaemon.test --test-name-pattern 'retries only the typed pre-execution result' — passed, all four real restart variants.
  • In libraries/package-deps-hash, node ../../apps/heft/lib-commonjs/start.js run --only test -- --clean — passed, 163 passed / 13 skipped.
  • In libraries/rush-daemon, node ../../apps/heft/lib-commonjs/start.js run --only test -- --clean --test-path-pattern 'DaemonGraphFixtureSetup|DaemonGraphFixturePaths' --max-workers 1 — passed, six tests.
  • Clean markers were removed from all three projects, including the short startup-workspace pattern. Diagnostic outputs remained. All 35 then-current source/asset hashes matched (source EOL-normalized, input bytes exact), and no test-owned Node process remained.

The initial Windows run exposed CRLF conversion of new text fixtures; fixture-local attributes fixed this without changing assertions. A local path-length assertion also verifies the listener's staging socket fits the Linux CI checkout with maximum Linux PID digits: 107 of 107 usable bytes.

The final FileSystem-only refactor has local validation as recorded above; its Windows validation remains with CI. The full repository matrix was not run locally. A completed Node 26 Linux job at the preceding commit failed only in the known delayed-pong wire test covered by #6153, not in a changed fixture test.

Impacted documentation

No website/API documentation changes. The test fixtures README documents immutable inputs, project-local workspace isolation, retained diagnostics, and Heft clean ownership. No-release change files are included for the three affected packages.

Check in immutable Git and daemon graph fixture inputs, copy them into isolated project-local workspaces, and let the Heft test clean phase remove retained outputs. Preserve daemon shutdown and child-process joins while removing teardown directory deletion that flakes on Windows.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use temp/sXXXXXX for the startup cases and clean only that generated workspace pattern. The longest staging socket in the Linux CI checkout now fits its 107-byte usable path limit, including maximum Linux PID digits.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Pin immutable fixture text to LF so copied Git inputs keep the byte hashes that the tests assert. Keep the existing hash and cache-restoration assertions unchanged.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Use node-core-library helpers for ordinary reads, writes, copies, path resolution, directory enumeration, and timestamps in the fixture cleanup. Preserve Buffer reads, strict file-deletion errors, and native APIs needed for temporary allocation, bigint stats, permissions, links, or native fs interception.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@iclanton
Ian Clanton-Thuon (iclanton) merged commit 6b81cfb into microsoft:main Oct 30, 2026
6 checks passed
@github-project-automation github-project-automation Bot moved this from Needs triage to Closed in Bug Triage Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Closed

Development

Successfully merging this pull request may close these issues.

2 participants