test harnesses leak an untrapped mktemp scratch dir per new_project() call (3223 accumulated) #514
Labels
No labels
component:adapters
component:lifecycle
component:qa
component:setup
component:shared
component:worktrees
phase/accepted
phase/backlog
phase/deployed
phase/developing
phase/integrating
phase/planning
phase/qa
phase/requirements
phase/uat
priority:critical
priority:critical
priority:high
priority:high
priority:low
priority:low
priority:medium
priority:medium
type:bug
type:chore
type:docs
type:feature
type:infra
type:tech-debt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
jbr870/devwork-skills#514
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
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?
What
new_project()in the shell test harnesses opens a second, untrappedmktemp -d. Each suitetraps only its own
$TMP:Nothing removes
$proj, so everynew_projectcall leaks a directory for the life of the box.Evidence
Measured on the dev host during QA round 1 of #45 (
/tmp):tmp.*directories accumulated in totalScope — pre-existing, but recently amplified
new_project()is present atbd2532cinprovenance.sh,typed-scan.shandtyped-scan-family.sh, so this is a house pattern, not a defect #45 invented. #45 replicated itand materially widened the blast radius: 37 new call sites across
supersede-read.sh(24) andsupersede-flow.sh(13), plusroll-call.sh.Why it is worth a ticket rather than a shrug
This is exactly the class
run-resource-claims.md§2 singles out as "the one that costs a day" —a shared writable scratch surface, invisible to both a file-boundary rule (which compares writer
against writer) and to the four suite-owned resource classes (which contain no such class). It is
also the one resource an actor's
claims:block cannot express today, which is why it went unnoticedthrough several features.
Nothing is currently broken by it — the leak is disk, not correctness — so this is
priority:low.But an unbounded per-run leak on a long-lived dev box or a CI runner eventually is a correctness
problem, and it is one line to close.
Suggested fix
Either allocate the project dir under the already-trapped
$TMP:…or accumulate the extra dirs and extend the trap. The first is smaller and needs no bookkeeping.
Apply it to all six suites that define
new_project(), not only #45's two.Provenance
Found by the driver's quiesce check at the
RELEASEofqa-testwriter-r1during QA round 1 onissue #45 —
run-resource-claims.md§5 requires confirming resources are freed before a releaseentry is written, and this is what that check exists to catch. Recorded as finding CR-20 on
qa-report
domain=code phase=validate(comment 2582) and dispositioneddefer-to-issuebydisposition-recommend.sh.