From d1db265b934db24268bbb2da780927fc1a2065f9 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 20 Nov 2026 07:10:49 -0300 Subject: test: terminals' drive starts its session with Verbose off, so Term's announcement (the builtin's name on its pane's message row, kept MessageLinger's 800 ms in a session no frontend dismisses) is no longer on the screen `before` is taken from and gone by the time ^U's answer is compared with it (process-test 'a control byte through pty/data ...' failed in each of merge31, 32 and 33's whole runs, and 'what a program prints past a screenful' once in 3 runs of the file: the screens differed in that one word, `Term` at the right of agent.txt's first row; a run fast enough to take `before` inside the 800 ms fails, a loaded one does not: 0 of 150 alone at a load of 35-43; with the linger 5000 and 5 s before ^U, 4 of 4 drive cases failed so, with Verbose off 0 of 9), and the screens printed when they differ; the case 0 of 3 in whole runs at a load of 32-40 Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- test/process/terminals.zig | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/process/terminals.zig b/test/process/terminals.zig index 24772ced..d9c3bcca 100644 --- a/test/process/terminals.zig +++ b/test/process/terminals.zig @@ -262,7 +262,9 @@ fn rawKey(gpa: std.mem.Allocator, exe: [:0]const u8) !void { /// thousand: nothing printed is nothing kept), then a probe typed and /// taken back with ^U. fn drive(gpa: std.mem.Allocator, exe: [:0]const u8, script: []const u8, key: ?u8, rows: usize) !void { - var d = try process.Detached.start(gpa, exe, "agent", .{}); + // No builtin announces itself: Term's name would linger on the screen + // (MessageLinger, 800 ms) and go between `before` and ^U's answer. + var d = try process.Detached.start(gpa, exe, "agent", .{ .init = "Verbose off\n" }); defer d.deinit(); const f = &d.files; try d.put("command.sh", f.at("exec /bin/sh -c '{s}'\n", .{script})); @@ -300,7 +302,10 @@ fn drive(gpa: std.mem.Allocator, exe: [:0]const u8, script: []const u8, key: ?u8 try f.write(data, "\x15"); const back_by = eh.nowMs() + 10_000; while (!std.mem.eql(u8, try f.screen(), before)) { - if (eh.nowMs() > back_by) return error.ScreenNotRestored; + if (eh.nowMs() > back_by) { + std.debug.print("before:\n{s}\nafter ^U:\n{s}\n", .{ before, try f.screen() }); + return error.ScreenNotRestored; + } sleepMs(10); } } -- cgit v1.3 From 7f306a01bf285689c31b9b6e1ec83341b15ce92c Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 20 Nov 2026 07:10:49 -0300 Subject: test: exec-bigdrag waits for the sweep's quiet once, with the 30 s cap its other waits have, not first with an 8 s one (bash fails the swept chunks as commands one by one, past 8 s under load: NeverStable at that wait in 6 of 9 runs at a load of 39-45, 5 of them failing again alone; after it 0 of 21 at that wait) Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- test/process/tty_terminals.zig | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/process/tty_terminals.zig b/test/process/tty_terminals.zig index d5540818..dfb027e2 100644 --- a/test/process/tty_terminals.zig +++ b/test/process/tty_terminals.zig @@ -844,7 +844,9 @@ fn exec_bigdrag(gpa: std.mem.Allocator, exe: [:0]const u8) !void { try t.drag("middle", "150", 31); try t.drag("middle", "198", 59); try t.release("middle", "198", 59); - try t.stable(500, 8000); + // Bash fails each swept chunk as a command, one by one: under load + // that runs well past 8 s, so the quiet is waited for once, with the + // cap the sweep's other waits have. try t.stable(800, 30000); // still alive: type and execute a marker command try t.press("left", "105", 41); -- cgit v1.3 From 03afd6e1186c82bccce41566e7044b7f9187f16b Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 20 Nov 2026 07:10:49 -0300 Subject: test: daemon.py's replica hello sends its first word in the same write, as a client's join does (core/replica.zig joinOn): a refused hello's connection is closed, and the second write met it (BrokenPipeError in replicas(), 1 of 3 plain runs at a load of 37; with 0.5 s between the two writes 2 of 2) Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- test/daemon.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/daemon.py b/test/daemon.py index d134732b..e68cc6ae 100644 --- a/test/daemon.py +++ b/test/daemon.py @@ -265,8 +265,11 @@ class Replica: is read, whole. A daemon of another replica protocol (an older build's, across an Upgrade) is dialled again in its own.""" name = session.encode() - self.send(0x01, struct.pack(' Date: Fri, 20 Nov 2026 07:35:27 -0300 Subject: test: daemon.py's by_hash waits up to 60 s for each 9P reply, not ninep.py's 5 s: the 17 MiB file's Look under two clients took 1.6-6.6 s in a Debug build at a load of 35 (measured in 5 --far runs), and a reply after the 5 s was read as the next one's ('invalid 9P reply header' in 2 of 3 plain runs) Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- test/daemon.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/daemon.py b/test/daemon.py index e68cc6ae..59a9c7d1 100644 --- a/test/daemon.py +++ b/test/daemon.py @@ -1275,7 +1275,10 @@ def by_hash(binary): started.append(sess.pid) wait_for('the replica socket', (root / 'pardes-replica.sock').exists) wait_for('the session\'s 9P socket', (root / 'pardes-9p-files.sock').exists) - nine = Client(root / 'pardes-9p-files.sock') + # Each reply waited for as long as the opens it answers take: the + # 17 MiB file's Look took 1.6-6.6 s in a Debug build at a load of + # 35 (ninep.py's 5 s is a reply's whole wait). + nine = Client(root / 'pardes-9p-files.sock', timeout=60) pane = next(int(row.split()[0]) for row in nine.read('/index').splitlines() if row.split()[1] == b'text') (ta, a), (tf, f) = client('a', False), client('f', True) seen = {n: len(checks(root / f'{n}.check')) for n in 'af'} -- cgit v1.3 From 58337a33e4661d951f25a844900e95fde3e804a8 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 20 Nov 2026 07:45:13 -0300 Subject: test: daemon.py's upgrade waits, before its Adopt after kill -9, for the daemon to list the next session (it has taken the hello its `ok` answers): the Adopt otherwise waited daemon.zig `kept`'s 2 s for that `ok` and was refused, 'no pardes daemon is keeping shells' (3 of 40 rounds of the step at a load of 33-37, each refused after 2.2 s; with the wait 0 of 40 at 32-36); the session answering so while its daemon is up is the start's fault, reported Co-Authored-By: Claude Opus Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T --- test/daemon.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'test') diff --git a/test/daemon.py b/test/daemon.py index 59a9c7d1..b846444a 100644 --- a/test/daemon.py +++ b/test/daemon.py @@ -2112,10 +2112,17 @@ def upgrades(old, new): sock = root / 'pardes-9p-again.sock' wait_for('the next session', sock.exists) client = Client(sock) - started.append(int(dict(line.split(maxsplit=1) for line in client.read('/status').decode().splitlines())['pid'])) + again = int(dict(line.split(maxsplit=1) for line in client.read('/status').decode().splitlines())['pid']) + started.append(again) # Its reader of the daemon starts after its first frame: an Adopt - # before that waits for an `ok` nobody reads, and is refused. + # before that waits for an `ok` nobody reads, and is refused. The + # daemon lists it once it has taken its hello, which its `ok` + # answers: an Adopt before that waits at most 2 s for the `ok` + # (daemon.zig `kept`), which a loaded machine can take (3 in 40 at + # a load of 35). wait_for('the next session\'s first frame', lambda: b'\x1b[?1049h' in term.text()) + wait_for('the next session listed by the daemon', lambda: f'session again {again} ' in subprocess.run( + [str(binary), '--ps'], env=env, capture_output=True, timeout=30).stdout.decode()) before = set(terminals(client)) client.write(f'/pane/{min(before)}/exec', b'Adopt\n') pane = wait_for('the adopted pane', lambda: set(terminals(client)) - before).pop() -- cgit v1.3