diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-23 09:16:01 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-23 10:58:26 -0300 |
| commit | ffc4f307ff330a8b13aa5c19df079e4664a573a2 (patch) | |
| tree | b31df7fd28660dd55e80d51ee6a0efd4f5b766da /test/process/terminals.zig | |
| parent | 9a648ef09bb32f42fb6b09bebbe8c851be360c6e (diff) | |
| download | pardes-ffc4f307ff330a8b13aa5c19df079e4664a573a2.tar.gz pardes-ffc4f307ff330a8b13aa5c19df079e4664a573a2.zip | |
test/daemon.py, test/process: a shell's first pty/run asked once, at once, its whole answer said when it is not what the row wants: `gui_upgrades`' setup failed twice this week on `int(b'')`, the answer never shown (it was `error not run`, the product's, the change before); now every first `echo $$` after a start is test/daemon.py `pid_in` (`exit 0` and a pid, or an AssertionError naming the pane and the answer whole), which replaces `adopted_pid` and the waits that stood in for the product's (a `true` run again until it answered `exit 0`): manage and relink (a session's Term), relink, answer_late, main, upgrades, upgrade_clients and gui_upgrades (a session's first terminal), upgrades (the run after the fallback, the fresh session's terminals), and the four adopted shells (relink, answer_late, main, upgrades); clients' first run in its new Term checks its answer; test/process: terminals.zig's `prompted` (a `true`-until-`exit 0` loop) deleted, sized's first run (`stty size`) asked at once, runFile's `while busy` loop ("deadline its first prompt": the greeting's `ls`) one run that must answer `exit 0`, look_and_exec.zig's `true`-until-`exit 0` loop one run; kept: terminals.zig's wait for a restarted shell (a run written at once can still reach the shell being replaced) and look_and_exec's for the shell back after `cat`; with the product change before: tui process-test 0 of 146 (load 6.2), test/daemon.py on ReleaseSafe plain 1/1, `--upgrade` from the installed build 1/1, `--upgrade --gui` from the installed build 5/5, `--relink` 20 of 20 (on the installed build 18 of 20 (two `error not run` on the adopted shell), each failure `AssertionError: pane 3: `echo $$` answered b'error not run\n'`: what adopted_pid's wait hid)
Co-Authored-By: Claude Opus <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'test/process/terminals.zig')
| -rw-r--r-- | test/process/terminals.zig | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/test/process/terminals.zig b/test/process/terminals.zig index 151b221b..8d595120 100644 --- a/test/process/terminals.zig +++ b/test/process/terminals.zig @@ -111,15 +111,6 @@ fn sizeLines(a: std.mem.Allocator, c: *process.Conn, n: u32) ![]const []const u8 return out.items; } -/// A shell takes runs: its first prompt, or the one started again. -fn prompted(a: std.mem.Allocator, c: *process.Conn, term: u32) !void { - const deadline = eh.nowMs() + 10_000; - while (!std.mem.eql(u8, try run(a, c, term, "true\n"), "exit 0\n")) { - if (eh.nowMs() > deadline) return error.NoPrompt; - process.sleep(50); - } -} - fn sizedFork(gpa: std.mem.Allocator, exe: [:0]const u8) !void { var d = try process.Detached.start(gpa, exe, "sized", .{}); defer d.deinit(); @@ -135,7 +126,7 @@ fn sizedFork(gpa: std.mem.Allocator, exe: [:0]const u8) !void { // the screen's 160x50. try c.write("/exec", "Term\n"); const term = try c.newest(gpa); - try prompted(a, c, term); + // Asked at once: a run waits for its first prompt and its greeting. var got = try sttySize(a, c, term); try expect(!std.mem.eql(u8, got[1], "50 160")); try expectEqualStrings(got[1], got[0]); @@ -200,11 +191,7 @@ fn runFile(gpa: std.mem.Allocator, exe: [:0]const u8) !void { const serial = try std.fmt.parseInt(u32, w.next().?, 10); if (std.mem.eql(u8, w.next().?, "term")) term = @max(term, serial); } - const deadline = eh.nowMs() + 10_000; - while (std.mem.eql(u8, try run(a, c, term, "true\n"), "busy\n")) { // deadline its first prompt - if (eh.nowMs() > deadline) return error.NoPrompt; - process.sleep(50); - } + try expectEqualStrings("exit 0\n", try run(a, c, term, "true\n")); // asked at once: it waits for the first prompt, and the greeting's try expectEqualStrings("exit 1\n", try run(a, c, term, "false\n")); try expectEqualStrings("exit 0\none\ntwo\n", try run(a, c, term, "printf \"one\\ntwo\\n\"\n")); // then what it printed try expectEqualStrings("exit 7\n", try run(a, c, term, "sh -c \"exit 7\"\n")); |
