From ffc4f307ff330a8b13aa5c19df079e4664a573a2 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Mon, 23 Nov 2026 09:16:01 -0300 Subject: 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 Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- test/process/look_and_exec.zig | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) (limited to 'test/process/look_and_exec.zig') diff --git a/test/process/look_and_exec.zig b/test/process/look_and_exec.zig index 9829797b..8ba52534 100644 --- a/test/process/look_and_exec.zig +++ b/test/process/look_and_exec.zig @@ -118,18 +118,8 @@ fn canary(gpa: std.mem.Allocator, exe: [:0]const u8) !void { // A terminal: pty/run failing then passing. const term = try f.madeBy(1, "Term\n"); - { - const deadline = process.nowMs() + 10_000; - while (true) { - const answer = try f.run(term, "true\n"); - if (std.mem.eql(u8, answer, "exit 0\n")) break; - if (process.nowMs() > deadline) { - std.debug.print("pty/run answered {s}\n", .{answer}); - return error.Timeout; - } - process.nap(50); - } - } + // Asked at once: a run waits for its first prompt and its greeting. + try std.testing.expectEqualStrings("exit 0\n", try f.run(term, "true\n")); try std.testing.expectEqualStrings("exit 1\n", try f.run(term, "false\n")); try std.testing.expectEqualStrings("exit 0\npassed\n", try f.run(term, "echo passed\n")); // (A run's answer is its record: the log has no err for these.) -- cgit v1.3