From bbae7225e939daf4b6360d3de7af06c0fd95ce8d Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Sat, 21 Nov 2026 06:21:57 -0300 Subject: pair: the process suite as pairs from 13 of 145 failing to 7 that stay (the goldens of one cause, open): the harness dials a pair's session, the launched client's child (test/process.zig `of`, `childOf`: it dialled the launched pid's socket); a Restore in a pair no daemon keeps is refused in words, as its Upgrade is (P42: runtime/session.zig `restore`: it let the client go and the session ended with its last link), and the three cases that Restore a pair run it with a daemon of their own root's (tty.zig `privateDaemon`, e2e_harness `PARDES_HARNESS_DAEMON`, process.zig `Detached.tty_daemon`, ended by `--kill-all` at its deinit); a pair's launch with no terminal says what the own path says and forks no session (main.zig `pair`, `noTerminal`: it said "pardes: NoDevice" after forking one); a terminal client ended by TERM or HUP dies of the signal once its goodbye is said and its terminal put back, as the own path's stub does (tui.zig `dieOfQuitSignal`: it exited 0 since pair-3), and the kill test takes a pair's hang-up as the close P36 ruled; PARDES_PAIR=1 process-test 8 of 145 (7 goldens of one family: resizes=2, a terminal panned in a view shorter than the one that sized it, a restored terminal's history; winch once), without the variable 0 of 145 Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- test/process/flags.zig | 4 +++- test/process/root_ctl.zig | 3 +++ test/process/tty_boot.zig | 2 ++ 3 files changed, 8 insertions(+), 1 deletion(-) (limited to 'test/process') diff --git a/test/process/flags.zig b/test/process/flags.zig index c9aa12fb..cfdb1faf 100644 --- a/test/process/flags.zig +++ b/test/process/flags.zig @@ -730,7 +730,9 @@ fn killedTty(gpa: std.mem.Allocator, exe: [:0]const u8) !void { killed.kill(sig); try exitsWith(&killed, -@as(c_int, @intCast(@intFromEnum(sig))), 5_000); const own_z = z(a, "{s}", .{own}); - if (sig == .HUP) { + // As a pair (PARDES_PAIR) a hangup is a close (P36): the session, + // its last client gone and not kept, ends with it. + if (sig == .HUP and std.c.getenv("PARDES_PAIR") == null) { // A hangup is the terminal's end: the session carries on // detached (the daemon keeps it) until told to end. try check(libc.access(own_z, 0) == 0, "a hangup ended the session", .{}); diff --git a/test/process/root_ctl.zig b/test/process/root_ctl.zig index e3420ac5..979cfc48 100644 --- a/test/process/root_ctl.zig +++ b/test/process/root_ctl.zig @@ -127,6 +127,9 @@ fn restore(gpa: std.mem.Allocator, exe: [:0]const u8) !void { defer d.deinit(); var term: ?process.Child = null; defer if (term) |*t| t.deinit(); + // As a pair, with a daemon of the root's own: the Restore lets its + // client go, and it joins again through it (P42). + if (tty) d.tty_daemon = exe; if (tty) term = try d.startTty(exe, name, &.{}); const address = d.abs(try std.fmt.allocPrint(a, "pardes-9p-{s}.sock", .{name})); const old = try Conn.dial(gpa, address); diff --git a/test/process/tty_boot.zig b/test/process/tty_boot.zig index 741f6260..51aea53b 100644 --- a/test/process/tty_boot.zig +++ b/test/process/tty_boot.zig @@ -271,6 +271,7 @@ fn load(gpa: std.mem.Allocator, exe: [:0]const u8) !void { fn restore(gpa: std.mem.Allocator, exe: [:0]const u8) !void { var t = try Tty.init(gpa, exe, "restore"); defer t.deinit(); + t.privateDaemon(); try t.start(31, 100, &.{ "-n", "1" }); try t.wait(8000, "Newcol Joincol"); try t.stable(700, 20000); @@ -380,6 +381,7 @@ fn headersweep(gpa: std.mem.Allocator, exe: [:0]const u8) !void { fn headersweep_restored(gpa: std.mem.Allocator, exe: [:0]const u8) !void { var t = try Tty.init(gpa, exe, "headersweep-restored"); defer t.deinit(); + t.privateDaemon(); try t.start(21, 120, &.{ "-n", "3" }); try t.wait(8000, "Newcol"); try t.stable(700, 20000); -- cgit v1.3