Stop leaking 66 MB knob-lab scaffolds into /tmp per test run #257
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
project_sweep_campaign.rs'sbuilt_scale_project()scaffoldsknob-lab+ a builtknob-lab-nodescrate (~66 MB, mostly the node crate'starget/) intostd::env::temp_dir().join(format!("aura-235-{pid}"))(crates/aura-cli/tests/project_sweep_campaign.rs:70 atd1b9d2b). The wipe on the next line (remove_dir_all(&base)) clears only the CURRENT process's base — the name is pid-suffixed, so no run ever reclaims a previous run's directory. Net effect: one leaked ~66 MB directory per test-binary process, forever.Observed 2026-07-13: 159
aura-235-*directories totalling ~10 GB filled the host's 16 GB/tmptmpfs to 100 %, breaking unrelated tempdir consumers (any test usingstd::env::temp_dir(), i.e. the wholefresh_project()E2E suite) until manually cleared.Fix shape: anchor the scaffold at a process-independent path on real disk —
CARGO_TARGET_TMPDIR(cargo sets it for integration-test builds; resolves totarget/tmp, covered bycargo clean) joined with a fixed name — so the existing wipe-before-scaffold reclaims the previous run's copy and the steady state is exactly one directory. Trade-off accepted: two concurrentcargo testinvocations over the same checkout would collide on the fixed name, a documented pre-existing caveat class for this suite (the shared-store race note intests/common/mod.rs's history, #223) — the pid suffix protected that scenario at the price of the unbounded leak.