diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-28 18:13:42 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:15 -0300 |
| commit | 4354669aa560c5504b046413f771d02c4216dd45 (patch) | |
| tree | 2dfd445ee3ca2f1c02895422fdf5f80d639ebdc5 /src/9p_io.zig | |
| parent | 33bb985d6d167af6866a5667ad027db5c2ad6b7c (diff) | |
| download | pardes-4354669aa560c5504b046413f771d02c4216dd45.tar.gz pardes-4354669aa560c5504b046413f771d02c4216dd45.zip | |
Shell prompt files are one per content under $XDG_RUNTIME_DIR, so a killed pardes leaves none behind; tests remove their /tmp dirs
Every pardes host wrote its own pardes-osc133-bash-* and -fish-* files to /tmp and removed them only at a clean teardown, so each killed session, test and crash left two: 72K of them had piled up. They are now written once per content, named by its hash, in the user's private runtime directory, renamed into place whole and shared by every pardes; without that directory the old private /tmp files remain. fish's -C source is quoted. The 9p_io tests remove their runtime dirs with what the listener left in them, and the snapshot runner removes its retry captures when every retry passed.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Diffstat (limited to 'src/9p_io.zig')
| -rw-r--r-- | src/9p_io.zig | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/9p_io.zig b/src/9p_io.zig index 8f56ff13..651b3d0a 100644 --- a/src/9p_io.zig +++ b/src/9p_io.zig @@ -1303,7 +1303,8 @@ test "Unix TCP and QUIC share one listener through reads writes reconnects and r var directory: [64:0]u8 = undefined; _ = try std.fmt.bufPrintSentinel(&directory, "/tmp/pardes-tcp-XXXXXX", .{}, 0); if (mkdtemp(&directory) == null) return error.TempDirectoryFailed; - defer _ = rmdir(&directory); + // What the listener posted and left inside goes with it. + defer std.Io.Dir.cwd().deleteTree(testing.io, std.mem.sliceTo(&directory, 0)) catch |err| std.debug.print("deleteTree: {s}\n", .{@errorName(err)}); const old_runtime = if (libc.getenv("XDG_RUNTIME_DIR")) |v| try gpa.dupeZ(u8, std.mem.span(v)) else null; defer { if (old_runtime) |v| { @@ -1414,7 +1415,8 @@ test "a change waits while the editor is out mid-step, a read does not, and the var directory: [64:0]u8 = undefined; _ = try std.fmt.bufPrintSentinel(&directory, "/tmp/pardes-park-XXXXXX", .{}, 0); if (mkdtemp(&directory) == null) return error.TempDirectoryFailed; - defer _ = rmdir(&directory); + // What the listener posted and left inside goes with it. + defer std.Io.Dir.cwd().deleteTree(testing.io, std.mem.sliceTo(&directory, 0)) catch |err| std.debug.print("deleteTree: {s}\n", .{@errorName(err)}); const old_runtime = if (libc.getenv("XDG_RUNTIME_DIR")) |v| try gpa.dupeZ(u8, std.mem.span(v)) else null; defer { if (old_runtime) |v| { @@ -1483,7 +1485,8 @@ test "a held read is answered when the log has news, and a flushed one spends no var directory: [64:0]u8 = undefined; _ = try std.fmt.bufPrintSentinel(&directory, "/tmp/pardes-held-XXXXXX", .{}, 0); if (mkdtemp(&directory) == null) return error.TempDirectoryFailed; - defer _ = rmdir(&directory); + // What the listener posted and left inside goes with it. + defer std.Io.Dir.cwd().deleteTree(testing.io, std.mem.sliceTo(&directory, 0)) catch |err| std.debug.print("deleteTree: {s}\n", .{@errorName(err)}); const old_runtime = if (libc.getenv("XDG_RUNTIME_DIR")) |v| try gpa.dupeZ(u8, std.mem.span(v)) else null; defer { if (old_runtime) |v| { |
