fix(tests): stop fixture helpers leaking temp dirs into /tmp #242

Merged
Defame1297 merged 1 commits from fix/test-fixture-tmp-leak into main 2026-11-28 17:37:13 +00:00
1 Commits
Author SHA1 Message Date
Defame1297 da88cd8d32 fix(tests): stop fixture helpers leaking temp dirs into /tmp
Why: new_repo/make_fixture/make_repo created a mktemp dir and appended
it to the cleanup array, but every caller runs them as R="$(helper)".
The append happens in that command-substitution subshell and is lost,
so the EXIT trap removed nothing. Each run leaked one dir per call:
31, 54, 22 and 9 for the four suites, about 1,700 dirs on one day.

Implementation Notes:
- Each suite creates one RUN_TMP root up front with a single
  `trap 'rm -rf "$RUN_TMP"' EXIT`; every fixture is `mktemp -d` under
  it, so cleanup no longer depends on where the helper runs.
- The CLEANUP_DIRS / FIXTURES arrays are gone from these four suites.
- test-check-scope-walkup-sync.sh and test-check-apm-agents-valid.sh
  already register fixtures in the caller and are unchanged.

Assisted-by: Claude Code
2026-11-28 14:40:47 +00:00