Skip to content

test(host): temp directories clean up after themselves (STORY-441, closes #710) - #786

Merged
genwave-radio merged 2 commits into
mainfrom
test/temp-dirs-clean-up-441
Sep 16, 2026
Merged

genwave-radio merged 2 commits into
mainfrom
test/temp-dirs-clean-up-441

Conversation

@genwave-radio

Copy link
Copy Markdown
Collaborator

Closes #710. PR-2 of the gh-#777 epic (STORY-441).

🧹 What

  • TempDir is the one way a Host.Tests spec owns a scratch directory: gw- prefix under the temp root, recursive delete on dispose, tolerant of a directory that already vanished.
  • TempSweep.Run removes stale gw-*, genwave-pawire-*, story343-env-* and gh332-* directories older than one hour; a module initializer runs it once per test process against the real temp root.
  • Every CreateTempSubdirectory call site (33 files) moved onto TempDir: using var for method scope, a fixture-owned field for scenario scope, TempDir.CreateForProcessLifetime() for static helpers that hand paths to child processes.
  • Story441 specs are green (11 facts); the AC4 source pin proves Support/TempDir.cs is the only remaining call site.

📏 Counts (T481 wire, dev box)

Measure Value
ls /tmp | grep -c '^gw-' before Story346 run 0
Story346 run (FeatureAdoptionVerifyRepair) Passed! - Failed: 0, Passed: 32
gw- count after 0
First sweep on the dev box 11227 → 1717 (the rest were younger than one hour)
Reviewer's unfiltered Host run 3148 passed, 504 skipped, 0 failed; gw- 445 → 0

✅ Gate

dotnet test GenWave.sln --filter "Category!=Integration" -- xUnit.MaxParallelThreads=3: all nine projects green (Host 2902 passed / 210 skipped / 0 failed).

…tch dirs (gh-#710)

Adds TempDir (IDisposable scratch directory under gw-*, recursive delete on
Dispose) and TempSweep.Run, which removes stale gw-/genwave-pawire-/
story343-env-/gh332- directories older than 1h. A module initializer runs
the sweep once per Host.Tests process against the real temp root.

The dev box had accumulated ~60k gw-* directories because specs creating
scratch dirs directly via CreateTempSubdirectory had no cleanup path when a
run was killed mid-test.
33 files: using var for method-scoped scratch dirs, fixture-owned TempDir
fields disposed alongside the scenario that created them, and
TempDir.CreateForProcessLifetime() for static helpers that hand a bare
path to child processes across many call sites. Story441's own pin file
no longer contains the literal API name it scans for.

Every scratch directory now has an explicit owner instead of leaking to
the OS temp root on a killed run — a Story346 test run leaves /tmp's
gw-* count flat instead of growing.
@genwave-radio
genwave-radio merged commit 618edcf into main Sep 16, 2026
11 checks passed
@genwave-radio
genwave-radio deleted the test/temp-dirs-clean-up-441 branch September 16, 2026 11:16
@github-actions github-actions Bot locked and limited conversation to collaborators Sep 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test: wizard/preflight specs leak temp dirs under /tmp (Story342–346, gh332, pawire) — ~60k dirs / ~500k inodes in a week

1 participant