summaryrefslogtreecommitdiff
path: root/test/process
diff options
context:
space:
mode:
authorGabriel Schneider <[email protected]>2026-11-19 20:55:36 -0300
committerGabriel Schneider <[email protected]>2026-11-19 23:43:13 -0300
commitb92578b797e6907a355b23f52b9b5202aa5967e0 (patch)
treea1a8f683da0625d2a251dc4262a7758c26201eea /test/process
parent261a652706c11615932b090f6572aa1732bff737 (diff)
downloadpardes-b92578b797e6907a355b23f52b9b5202aa5967e0.tar.gz
pardes-b92578b797e6907a355b23f52b9b5202aa5967e0.zip
test: three of the known process-test flakes wait on what they need, and grep's golden stops pinning a count still counting: winch typed its long line once `c-b` had started the pane's shell and the screen had held still 600 ms, so a loaded bash echoed it through the kernel before readline was up and drew it again, or ran it before the pane's own `ls` (12 of 20 runs failed, load 38-54; not the 600 SIGWINCHes: the tty drops a WINCH whose size did not change): it now waits for the pane's prompt row after its `ls`; headersweep and headersweep-restored waited for the echo's line, which the command pane's one body row shows only until `exit 0` follows it (10 of 20 failed, the wait timing out on a pane already at `exit 0`): they wait for the tag's `(echo SW''EPT-COL) exit 0`, which stays and names the whole swept command; grep's golden pinned `+Search 0+`, the count while a typed Grep's 80 ms pause and its worker still run, which the quiet machine's 60 ms stable probe caught and a loaded one not (9 of 20 failed): it waits for the query typed in, then for the final `+Search 0 `, and the golden says `0`; after, 50 runs each under load 42-98: winch 0, headersweep (both) 1 (the 8 s cap on the first frame at load 90, not a race), grep 0 of 45 (5 lost to a cache wipe); hscroll, pagercolor and Lspinfo did not fail in 50 runs each (left); cmdexit failed 1 of 50, a product race left for the terminal's owner (the report)
Co-Authored-By: Claude Opus <[email protected]> Claude-Session: https://claude.ai/code/session_016Y9MNBECMWcJD5pdS4SR6T
Diffstat (limited to 'test/process')
-rw-r--r--test/process/tty_boot.zig15
-rw-r--r--test/process/tty_editing.zig6
2 files changed, 17 insertions, 4 deletions
diff --git a/test/process/tty_boot.zig b/test/process/tty_boot.zig
index a5f42074..741f6260 100644
--- a/test/process/tty_boot.zig
+++ b/test/process/tty_boot.zig
@@ -300,6 +300,9 @@ fn restore(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
// when it comes up. Both headers used to run the word under the PRESS, on
// the press, so a sweep of `echo SWEPT-COL` ran a bare `echo`. A right sweep
// looks for what it swept the same way, and the other button cancels.
+// What a sweep ran is waited for in its pane's tag, `(echo SW''EPT-COL) exit
+// 0`, which stays: the echo's line shows in the pane's one body row only
+// until `exit 0` follows it, and a loaded machine draws both in one frame.
fn headersweep(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
var t = try Tty.init(gpa, exe, "headersweep");
defer t.deinit();
@@ -321,7 +324,7 @@ fn headersweep(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
try t.style("col-sweeping");
try t.drag("middle", "@echo+16", 2);
try t.release("middle", "@echo+16", 2);
- try t.wait(8000, "SWEPT-COL");
+ try t.wait(8000, "EPT-COL) exit 0");
try t.stable(700, 15000);
try t.snap("col-swept");
// the workspace tag, the same
@@ -335,7 +338,7 @@ fn headersweep(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
try t.press("middle", "@echo", 1);
try t.drag("middle", "@echo+15", 1);
try t.release("middle", "@echo+15", 1);
- try t.wait(8000, "SWEPT-WS");
+ try t.wait(8000, "EPT-WS) exit 0");
try t.stable(700, 15000);
try t.snap("ws-swept");
// a right sweep over part of a word looks for the part: `hay.txt` opens,
@@ -399,7 +402,7 @@ fn headersweep_restored(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
try t.style("col-sweeping");
try t.drag("middle", "@echo+19", 2);
try t.release("middle", "@echo+19", 2);
- try t.wait(8000, "RESTORED-COL");
+ try t.wait(8000, "-COL) exit 0");
try t.stable(700, 15000);
try t.snap("col-swept");
try t.press("left", "118", 1);
@@ -415,7 +418,7 @@ fn headersweep_restored(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
try t.style("ws-sweeping");
try t.drag("middle", "@echo+18", 1);
try t.release("middle", "@echo+18", 1);
- try t.wait(8000, "RESTORED-WS");
+ try t.wait(8000, "-WS) exit 0");
try t.stable(700, 15000);
try t.snap("ws-swept");
try t.done();
@@ -869,6 +872,10 @@ fn winch(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
try t.start(31, 100, &.{ "-n", "3" });
try t.stable(700, 20000);
try t.key("c-b");
+ // Its shell at its prompt after its `ls` (a row of the 50-column pane
+ // holding `$` alone): typed into earlier, a loaded machine's bash echoed
+ // the line before its readline was up, or ran it before the `ls`.
+ try t.wait(20000, "\n $" ++ @as([47]u8, @splat(' ')));
try t.stable(600, 8000);
try t.send("for i in $(seq 600); do kill -WINCH $PPID; done; echo SUR''VIVED");
try t.key("enter");
diff --git a/test/process/tty_editing.zig b/test/process/tty_editing.zig
index b5f0495c..63c75512 100644
--- a/test/process/tty_editing.zig
+++ b/test/process/tty_editing.zig
@@ -783,6 +783,12 @@ fn grep(gpa: std.mem.Allocator, exe: [:0]const u8) !void {
try t.key("g");
try t.stable(400, 5000);
try t.send("zzqq");
+ // Its count once the search is over (`0`): `0+` is while it still
+ // counts (its pause on the clock, then the worker), which a quiet
+ // machine's frame shows and a loaded one's not. The query typed in
+ // first: the pane's empty query counts `0` too.
+ try t.wait(10000, "Grep zzqq");
+ try t.wait(10000, "+Search 0 ");
try t.stable(700, 10000);
try t.snap("nomatch");
try t.key("esc");