a73x

9c560b9e

fix: a temp directory that will not delete now says so

a73x   2026-08-08 18:23

Commit message
fix: a temp directory that will not delete now says so

`cleanup` swallowed deleteTree's error. That is the shape this project has
been bitten by before — a failure whose false branch is indistinguishable
from success — so a directory that could not be removed looked exactly like
one that was, and the suite's claim to leave nothing behind was unfalsifiable
by construction.

Still non-fatal: a test that passed must not be failed by its own tidying.
But it prints now, which is the whole difference between "leaves nothing
behind" and "leaves things behind and never mentions it".

Deliberately its own commit. This was NOT diagnostic for the transient — the
leaks came from concurrent processes aborting elsewhere, and this line would
not have found them — and bundling it with that investigation would imply a
role it did not play.

The reporting branch is verified rather than assumed compiled: {t} renders a
real deleteTree failure as "AccessDenied" under the pinned toolchain.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

src/testtmp.zig
Old New
@@ -51,7 +51,18 @@ pub const TmpDir = struct {
51 if (self.len == 0) return; 51 if (self.len == 0) return;
52 const p = self.path(); 52 const p = self.path();
53 self.dir.close(); 53 self.dir.close();
54 std.fs.cwd().deleteTree(p) catch {}; 54 // Said out loud rather than swallowed. A `catch {}` here has the
55 // shape this project has been bitten by before: a failure whose
56 // false branch is indistinguishable from success, so a directory
57 // that could not be removed looks exactly like one that was. It
58 // stays non-fatal — a test that passed must not be failed by its own
59 // tidying — but it stops being silent, because the difference
60 // between "the suite leaves nothing behind" and "the suite leaves
61 // things behind and never mentions it" is a whole afternoon of
62 // hunting when something else starts leaking.
63 std.fs.cwd().deleteTree(p) catch |err| {
64 std.debug.print("testtmp: could not remove {s}: {t}\n", .{ p, err });
65 };
55 self.len = 0; 66 self.len = 0;
56 } 67 }
57 }; 68 };