a73x

4e05e47d

refactor: fold the simple rc checks into e2e_lib's rc0

a73x   2026-09-01 19:13

Commit message
refactor: fold the simple rc checks into e2e_lib's rc0

58 of the 82 plain `[ "$RC" -eq 0 ] || { echo; cat; exit 1; }` blocks
become one-line rc0 calls; the ~24 that compare RC to specific values,
kill something, or dump state on the way out keep their bespoke form.
The per-leg failure prose moves into the argument untouched — rc0
appends no suffix of its own because the messages carry $RC in
positions no suffix could reproduce. Suite pins unmoved at 105/38.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

test/e2e_02_predict.sh
Old New
@@ -98,9 +98,7 @@ set +e
98 wait "$P1PID" 98 wait "$P1PID"
99 RC=$? 99 RC=$?
100 set -e 100 set -e
101 [ "$RC" -eq 0 ] || { 101 rc0 "line-mode prediction client exited $RC" "$OUT.p1" "$OUT.p1.err"
102 echo "e2e FAIL: line-mode prediction client exited $RC"
103 cat "$OUT.p1" "$OUT.p1.err" 2>/dev/null; exit 1; }
104 102
105 # The underlined glyph, in the snapshot taken before the echo could arrive. 103 # The underlined glyph, in the snapshot taken before the echo could arrive.
106 # This is the whole claim of the milestone, as an effect rather than a 104 # This is the whole claim of the milestone, as an effect rather than a
@@ -141,9 +139,7 @@ set +e
141 > "$OUT.pb" 2> "$OUT.pb.err" 139 > "$OUT.pb" 2> "$OUT.pb.err"
142 RC=$? 140 RC=$?
143 set -e 141 set -e
144 [ "$RC" -eq 0 ] || { 142 rc0 "burst client exited $RC" "$OUT.pb" "$OUT.pb.err"
145 echo "e2e FAIL: burst client exited $RC"
146 cat "$OUT.pb" "$OUT.pb.err" 2>/dev/null; exit 1; }
147 143
148 # Five keystrokes typed at 250ms into a 600ms round trip: three are always 144 # Five keystrokes typed at 250ms into a 600ms round trip: three are always
149 # outstanding at once (at t=600, when the first is confirmed, the keys typed 145 # outstanding at once (at t=600, when the first is confirmed, the keys typed
@@ -220,9 +216,7 @@ set +e
220 MUX_PREDICT_STATS=1 timeout 40 "$MUX" --sock "$SOCK6" > "$OUT.pw" 2> "$OUT.pw.err" 216 MUX_PREDICT_STATS=1 timeout 40 "$MUX" --sock "$SOCK6" > "$OUT.pw" 2> "$OUT.pw.err"
221 RC=$? 217 RC=$?
222 set -e 218 set -e
223 [ "$RC" -eq 0 ] || { 219 rc0 "password client exited $RC" "$OUT.pw" "$OUT.pw.err"
224 echo "e2e FAIL: password client exited $RC"
225 cat "$OUT.pw" "$OUT.pw.err" 2>/dev/null; exit 1; }
226 220
227 # Nothing was shown, and nothing was even attempted: echo-off canonical is 221 # Nothing was shown, and nothing was even attempted: echo-off canonical is
228 # the tier where a prediction must never be MADE, not merely never painted, 222 # the tier where a prediction must never be MADE, not merely never painted,
@@ -269,9 +263,7 @@ set +e
269 > "$OUT.rw" 2> "$OUT.rw.err" 263 > "$OUT.rw" 2> "$OUT.rw.err"
270 RC=$? 264 RC=$?
271 set -e 265 set -e
272 [ "$RC" -eq 0 ] || { 266 rc0 "rawmode client exited $RC" "$OUT.rw" "$OUT.rw.err"
273 echo "e2e FAIL: rawmode client exited $RC"
274 cat "$OUT.rw" "$OUT.rw.err" 2>/dev/null; exit 1; }
275 267
276 # Four printable keystrokes made predictions; the 0x00 that switched modes 268 # Four printable keystrokes made predictions; the 0x00 that switched modes
277 # is not printable and was refused. 269 # is not printable and was refused.
@@ -325,9 +317,7 @@ set +e
325 MUX_PREDICT_STATS=1 timeout 40 "$MUX" --sock "$SOCK7" > "$OUT.rwl" 2> "$OUT.rwl.err" 317 MUX_PREDICT_STATS=1 timeout 40 "$MUX" --sock "$SOCK7" > "$OUT.rwl" 2> "$OUT.rwl.err"
326 RC=$? 318 RC=$?
327 set -e 319 set -e
328 [ "$RC" -eq 0 ] || { 320 rc0 "rawmode local client exited $RC" "$OUT.rwl" "$OUT.rwl.err"
329 echo "e2e FAIL: rawmode local client exited $RC"
330 cat "$OUT.rwl" "$OUT.rwl.err" 2>/dev/null; exit 1; }
331 want_stat "$OUT.rwl.err" made 4 "raw mode local" 321 want_stat "$OUT.rwl.err" made 4 "raw mode local"
332 want_stat "$OUT.rwl.err" confirmed 3 "raw mode local" 322 want_stat "$OUT.rwl.err" confirmed 3 "raw mode local"
333 want_stat "$OUT.rwl.err" displayed 0 "raw mode local" 323 want_stat "$OUT.rwl.err" displayed 0 "raw mode local"
@@ -371,9 +361,7 @@ set +e
371 wait "$PRPID" 361 wait "$PRPID"
372 RC=$? 362 RC=$?
373 set -e 363 set -e
374 [ "$RC" -eq 0 ] || { 364 rc0 "reconnect client exited $RC" "$OUT.pr" "$OUT.pr.err"
375 echo "e2e FAIL: reconnect client exited $RC"
376 cat "$OUT.pr" "$OUT.pr.err" 2>/dev/null; exit 1; }
377 365
378 # The queue is empty at exit, by attribution rather than by inspection: 366 # The queue is empty at exit, by attribution rather than by inspection:
379 # nothing predicted is still outstanding, and the flush that dropped the 367 # nothing predicted is still outstanding, and the flush that dropped the
@@ -426,8 +414,7 @@ waitexit 10000
426 EOF 414 EOF
427 RC=$? 415 RC=$?
428 set -e 416 set -e
429 [ "$RC" -eq 0 ] || { 417 rc0 "ptyclient roundtrip over cat exited $RC:" "$PCLOG"
430 echo "e2e FAIL: ptyclient roundtrip over cat exited $RC:"; cat "$PCLOG"; exit 1; }
431 grep -q "hello" "$OUT.pc" || { 418 grep -q "hello" "$OUT.pc" || {
432 echo "e2e FAIL: ptyclient capture missing the pty echo"; cat -v "$OUT.pc"; exit 1; } 419 echo "e2e FAIL: ptyclient capture missing the pty echo"; cat -v "$OUT.pc"; exit 1; }
433 # The must-fail leg. 500ms: nothing is being waited FOR — the needle never 420 # The must-fail leg. 500ms: nothing is being waited FOR — the needle never
@@ -458,8 +445,7 @@ waitexit 10000
458 EOF 445 EOF
459 RC=$? 446 RC=$?
460 set -e 447 set -e
461 [ "$RC" -eq 0 ] || { 448 rc0 "ptyclient stderr-split leg exited $RC:" "$PCLOG.3"
462 echo "e2e FAIL: ptyclient stderr-split leg exited $RC:"; cat "$PCLOG.3"; exit 1; }
463 grep -q "pc-stdout" "$OUT.pc3" || { 449 grep -q "pc-stdout" "$OUT.pc3" || {
464 echo "e2e FAIL: ptyclient capture missing the child's stdout"; cat -v "$OUT.pc3"; exit 1; } 450 echo "e2e FAIL: ptyclient capture missing the child's stdout"; cat -v "$OUT.pc3"; exit 1; }
465 ! grep -q "pc-stderr" "$OUT.pc3" || { 451 ! grep -q "pc-stderr" "$OUT.pc3" || {
@@ -540,8 +526,7 @@ waitexit 10000
540 EOF 526 EOF
541 RC=$? 527 RC=$?
542 set -e 528 set -e
543 [ "$RC" -eq 0 ] || { 529 rc0 "tp2a ptyclient exited $RC:" "$OUT.tp2a.log"
544 echo "e2e FAIL: tp2a ptyclient exited $RC:"; cat "$OUT.tp2a.log"; exit 1; }
545 assert_converged_pty "$OUT.tp2a" "$SOCK12" "pty attach at 100x30" 100 30 530 assert_converged_pty "$OUT.tp2a" "$SOCK12" "pty attach at 100x30" 100 30
546 531
547 # Resize UP, not down: a replica LARGER than the grid is invisible (the 532 # Resize UP, not down: a replica LARGER than the grid is invisible (the
@@ -619,8 +604,7 @@ waitexit 10000
619 EOF 604 EOF
620 RC=$? 605 RC=$?
621 set -e 606 set -e
622 [ "$RC" -eq 0 ] || { 607 rc0 "tp2b ptyclient exited $RC:" "$OUT.tp2b.log"
623 echo "e2e FAIL: tp2b ptyclient exited $RC:"; cat "$OUT.tp2b.log"; exit 1; }
624 # Graded against the mutation (row 7: the prefix resize commented out) in 608 # Graded against the mutation (row 7: the prefix resize commented out) in
625 # this exact shape: 10 targeted runs, 10 red, plus a red full-suite run. What 609 # this exact shape: 10 targeted runs, 10 red, plus a red full-suite run. What
626 # dies is the WITNESS, above — a replica still 90 wide cannot paint 91 610 # dies is the WITNESS, above — a replica still 90 wide cannot paint 91
test/e2e_05_session.sh
Old New
@@ -114,9 +114,7 @@ set +e
114 timeout 20 "$MUX" a status --sock "$SOCK21" --session b > "$OUT.m18mst" 2>&1 114 timeout 20 "$MUX" a status --sock "$SOCK21" --session b > "$OUT.m18mst" 2>&1
115 RC=$? 115 RC=$?
116 set -e 116 set -e
117 [ "$RC" -eq 0 ] || { 117 rc0 "M18: mux a status --session b exited $RC:" "$OUT.m18mst"
118 echo "e2e FAIL: M18: mux a status --session b exited $RC:"
119 cat "$OUT.m18mst"; exit 1; }
120 # Not the exit code alone: a silently empty object would pass that. `cols` 118 # Not the exit code alone: a silently empty object would pass that. `cols`
121 # is a field only a decoded StatusReply can put there (agent.sh's shape). 119 # is a field only a decoded StatusReply can put there (agent.sh's shape).
122 grep -q '"cols"' "$OUT.m18mst" || { 120 grep -q '"cols"' "$OUT.m18mst" || {
@@ -127,9 +125,7 @@ set +e
127 timeout 20 "$MUX" a capture --sock "$SOCK21" --session a > "$OUT.m18mcap" 2>&1 125 timeout 20 "$MUX" a capture --sock "$SOCK21" --session a > "$OUT.m18mcap" 2>&1
128 RC=$? 126 RC=$?
129 set -e 127 set -e
130 [ "$RC" -eq 0 ] || { 128 rc0 "M18: mux a capture --session a exited $RC:" "$OUT.m18mcap"
131 echo "e2e FAIL: M18: mux a capture --session a exited $RC:"
132 cat "$OUT.m18mcap"; exit 1; }
133 grep -q 'm18a-pin' "$OUT.m18mcap" || { 129 grep -q 'm18a-pin' "$OUT.m18mcap" || {
134 echo "e2e FAIL: M18: mux a capture --session a did not return a's grid:" 130 echo "e2e FAIL: M18: mux a capture --session a did not return a's grid:"
135 cat "$OUT.m18mcap"; exit 1; } 131 cat "$OUT.m18mcap"; exit 1; }
test/e2e_07_wallcli.sh
Old New
@@ -88,9 +88,7 @@ EOF
88 RC=$? 88 RC=$?
89 set -e 89 set -e
90 wait "$CWINJPID" 2>/dev/null || true 90 wait "$CWINJPID" 2>/dev/null || true
91 [ "$RC" -eq 0 ] || { 91 rc0 "CLI wall: ptyclient leg exited $RC:" "$OUT.cwpc" "$OUT.cwinj"
92 echo "e2e FAIL: CLI wall: ptyclient leg exited $RC:"
93 cat "$OUT.cwpc"; cat "$OUT.cwinj"; exit 1; }
94 # The multiattach fact itself: both sessions' bytes in ONE process's 92 # The multiattach fact itself: both sessions' bytes in ONE process's
95 # capture. Redundant with the expects above only until someone edits the 93 # capture. Redundant with the expects above only until someone edits the
96 # script block; a grep each keeps the claim standing on its own. 94 # script block; a grep each keeps the claim standing on its own.
@@ -145,9 +143,7 @@ waitexit 10000
145 EOF 143 EOF
146 RC=$? 144 RC=$?
147 set -e 145 set -e
148 [ "$RC" -eq 0 ] || { 146 rc0 "prefix: ptyclient leg exited $RC (did \\x1cd detach?):" "$OUT.pfx.log"
149 echo "e2e FAIL: prefix: ptyclient leg exited $RC (did \\x1cd detach?):"
150 cat "$OUT.pfx.log"; exit 1; }
151 grep -q "m1-pin" "$OUT.pfx" || { 147 grep -q "m1-pin" "$OUT.pfx" || {
152 echo "e2e FAIL: prefix: the marker never printed"; exit 1; } 148 echo "e2e FAIL: prefix: the marker never printed"; exit 1; }
153 grep -q "zprintf" "$OUT.pfx" && { 149 grep -q "zprintf" "$OUT.pfx" && {
@@ -216,9 +212,7 @@ waitexit 10000
216 EOF 212 EOF
217 RC=$? 213 RC=$?
218 set -e 214 set -e
219 [ "$RC" -eq 0 ] || { 215 rc0 "new session: ptyclient leg exited $RC (did \\x1cc make a tile?):" "$OUT.nsw.log"
220 echo "e2e FAIL: new session: ptyclient leg exited $RC (did \\x1cc make a tile?):"
221 cat "$OUT.nsw.log"; exit 1; }
222 "$MUX" a status --sock "$SOCK28" --session 1 > "$OUT.nswst" 2>&1 || { 216 "$MUX" a status --sock "$SOCK28" --session 1 > "$OUT.nswst" 2>&1 || {
223 echo "e2e FAIL: new session: the chord did not create session 1:" 217 echo "e2e FAIL: new session: the chord did not create session 1:"
224 cat "$OUT.nswst"; exit 1; } 218 cat "$OUT.nswst"; exit 1; }
@@ -268,9 +262,7 @@ waitexit 10000
268 EOF 262 EOF
269 RC=$? 263 RC=$?
270 set -e 264 set -e
271 [ "$RC" -eq 0 ] || { 265 rc0 "new session: the saturated-wall leg exited $RC:" "$OUT.nsw2.log"
272 echo "e2e FAIL: new session: the saturated-wall leg exited $RC:"
273 cat "$OUT.nsw2.log"; exit 1; }
274 # The refusal is NOT fatal, and the three claims below are what "recovered" 266 # The refusal is NOT fatal, and the three claims below are what "recovered"
275 # means — none of which the log shows on its own. 267 # means — none of which the log shows on its own.
276 # 268 #
@@ -371,9 +363,7 @@ waitexit 10000
371 EOF 363 EOF
372 RC=$? 364 RC=$?
373 set -e 365 set -e
374 [ "$RC" -eq 0 ] || { 366 rc0 "session ring: ptyclient leg exited $RC (did \\x1cn wrap?):" "$OUT.ring.log"
375 echo "e2e FAIL: session ring: ptyclient leg exited $RC (did \\x1cn wrap?):"
376 cat "$OUT.ring.log"; exit 1; }
377 for s in 0:m3a 1:m3b 2:m3c; do 367 for s in 0:m3a 1:m3b 2:m3c; do
378 _sess="${s%%:*}"; _mark="${s##*:}-pin" 368 _sess="${s%%:*}"; _mark="${s##*:}-pin"
379 timeout 20 "$MUX" a capture --sock "$SOCK29" --session "$_sess" > "$OUT.ringcap" 2>&1 369 timeout 20 "$MUX" a capture --sock "$SOCK29" --session "$_sess" > "$OUT.ringcap" 2>&1
test/e2e_08_mouse.sh
Old New
@@ -109,9 +109,7 @@ waitexit 10000
109 EOF 109 EOF
110 RC=$? 110 RC=$?
111 set -e 111 set -e
112 [ "$RC" -eq 0 ] || { 112 rc0 "wheel: ptyclient leg exited $RC (did the wheel scroll, and come back?):" "$OUT.whl.log"
113 echo "e2e FAIL: wheel: ptyclient leg exited $RC (did the wheel scroll, and come back?):"
114 cat "$OUT.whl.log"; exit 1; }
115 # The other half of "the wheel is the client's": the bytes are CONSUMED. 113 # The other half of "the wheel is the client's": the bytes are CONSUMED.
116 # Seventeen mouse reports were typed at a shell that would have echoed every 114 # Seventeen mouse reports were typed at a shell that would have echoed every
117 # one of them, and the session's grid must hold none. 115 # one of them, and the session's grid must hold none.
@@ -170,9 +168,7 @@ waitexit 10000
170 EOF 168 EOF
171 RC=$? 169 RC=$?
172 set -e 170 set -e
173 [ "$RC" -eq 0 ] || { 171 rc0 "app mouse: ptyclient leg exited $RC (did the wheel reach the app?):" "$OUT.mse.log"
174 echo "e2e FAIL: app mouse: ptyclient leg exited $RC (did the wheel reach the app?):"
175 cat "$OUT.mse.log"; exit 1; }
176 # The session's own grid, not just the client's screen: the echo is the pty 172 # The session's own grid, not just the client's screen: the echo is the pty
177 # saying it received the bytes. 173 # saying it received the bytes.
178 timeout 20 "$MUX" a capture --sock "$SOCK34" > "$OUT.msecap" 2>&1 174 timeout 20 "$MUX" a capture --sock "$SOCK34" > "$OUT.msecap" 2>&1
@@ -241,8 +237,7 @@ waitexit 10000
241 EOF 237 EOF
242 RC=$? 238 RC=$?
243 set -e 239 set -e
244 [ "$RC" -eq 0 ] || { 240 rc0 "pager: ptyclient leg exited $RC:" "$OUT.pgr.log"
245 echo "e2e FAIL: pager: ptyclient leg exited $RC:"; cat "$OUT.pgr.log"; exit 1; }
246 # `mux d dump`, not `mux a capture`: the assertions below are WHOLE-LINE ones 241 # `mux d dump`, not `mux a capture`: the assertions below are WHOLE-LINE ones
247 # and capture answers in JSON, where the grid is one line with escaped 242 # and capture answers in JSON, where the grid is one line with escaped
248 # newlines in it — a `grep -x` against that can never match. (It did not, 243 # newlines in it — a `grep -x` against that can never match. (It did not,
@@ -288,8 +283,7 @@ D33PID=$DPID
288 { printf 'hello \033[<64;10;5M world\n'; sleep 1; printf '\034d'; } | 283 { printf 'hello \033[<64;10;5M world\n'; sleep 1; printf '\034d'; } |
289 timeout 20 "$MUX" --sock "$SOCK36" > "$OUT.pipe" 2>&1 284 timeout 20 "$MUX" --sock "$SOCK36" > "$OUT.pipe" 2>&1
290 RC=$? 285 RC=$?
291 [ "$RC" -eq 0 ] || { 286 rc0 "pipe stdin: the client exited $RC:" "$OUT.pipe"
292 echo "e2e FAIL: pipe stdin: the client exited $RC:"; cat "$OUT.pipe"; exit 1; }
293 # Not wait_grid: this asks `mux a capture`, the agent surface, not 287 # Not wait_grid: this asks `mux a capture`, the agent surface, not
294 # `mux d dump` — the piped client is the thing under test, so the reading 288 # `mux d dump` — the piped client is the thing under test, so the reading
295 # has to come down the same road an agent would use. 289 # has to come down the same road an agent would use.
@@ -389,9 +383,7 @@ RC=$?
389 set -e 383 set -e
390 unwatch_clients "$OUT.zswatch" 384 unwatch_clients "$OUT.zswatch"
391 ZSATT_AFTER=$(attaches_now "$SOCK37") 385 ZSATT_AFTER=$(attaches_now "$SOCK37")
392 [ "$RC" -eq 0 ] || { 386 rc0 "focus skip: ptyclient leg exited $RC (did \\x1cn and \\x1c1 move the focus?):" "$OUT.zspc"
393 echo "e2e FAIL: focus skip: ptyclient leg exited $RC (did \\x1cn and \\x1c1 move the focus?):"
394 cat "$OUT.zspc"; exit 1; }
395 # Where each marker landed. `mux a capture` reads the session's own grid, so 387 # Where each marker landed. `mux a capture` reads the session's own grid, so
396 # none of this can be an echo of what this script typed at a terminal. 388 # none of this can be an echo of what this script typed at a terminal.
397 timeout 20 "$MUX" a capture --sock "$SOCK37" > "$OUT.zsfa" 2>&1 389 timeout 20 "$MUX" a capture --sock "$SOCK37" > "$OUT.zsfa" 2>&1
@@ -491,9 +483,7 @@ waitexit 10000
491 EOF 483 EOF
492 RC=$? 484 RC=$?
493 set -e 485 set -e
494 [ "$RC" -eq 0 ] || { 486 rc0 "wheel: ptyclient leg exited $RC (did the focused wheel scroll?):" "$OUT.zwpc"
495 echo "e2e FAIL: wheel: ptyclient leg exited $RC (did the focused wheel scroll?):"
496 cat "$OUT.zwpc"; exit 1; }
497 # The anchor first, and it is a POSITIVE: a keystroke typed at the focused 487 # The anchor first, and it is a POSITIVE: a keystroke typed at the focused
498 # tile reached this session's pty. The silent half below is measured against 488 # tile reached this session's pty. The silent half below is measured against
499 # it, so a leg that fell over early can never pass by having done nothing. 489 # it, so a leg that fell over early can never pass by having done nothing.
@@ -556,9 +546,7 @@ waitexit 10000
556 EOF 546 EOF
557 RC=$? 547 RC=$?
558 set -e 548 set -e
559 [ "$RC" -eq 0 ] || { 549 rc0 "app mouse: ptyclient leg exited $RC (did the wheel reach the app?):" "$OUT.zm2pc"
560 echo "e2e FAIL: app mouse: ptyclient leg exited $RC (did the wheel reach the app?):"
561 cat "$OUT.zm2pc"; exit 1; }
562 # The session's own grid, not just this terminal: the echo is the pty saying 550 # The session's own grid, not just this terminal: the echo is the pty saying
563 # it received the bytes. 551 # it received the bytes.
564 timeout 20 "$MUX" a capture --sock "$SOCK42" > "$OUT.zm2capg" 2>&1 552 timeout 20 "$MUX" a capture --sock "$SOCK42" > "$OUT.zm2capg" 2>&1
test/e2e_09_hosts.sh
Old New
@@ -114,9 +114,7 @@ waitexit 10000
114 EOF 114 EOF
115 RC=$? 115 RC=$?
116 set -e 116 set -e
117 [ "$RC" -eq 0 ] || { 117 rc0 "hosts: the auto-start leg exited $RC (did the listed local daemon start?):" "$OUT.hauto.log" "$OUT.hauto.err"
118 echo "e2e FAIL: hosts: the auto-start leg exited $RC (did the listed local daemon start?):"
119 cat "$OUT.hauto.log"; cat "$OUT.hauto.err" 2>/dev/null; exit 1; }
120 HAPID=$(sed -n 's/.* pid=\([0-9]*\).*/\1/p' "$OUT.hauto.err" | head -1) 118 HAPID=$(sed -n 's/.* pid=\([0-9]*\).*/\1/p' "$OUT.hauto.err" | head -1)
121 defer_kill "$HAPID" 119 defer_kill "$HAPID"
122 [ -n "$HAPID" ] || { 120 [ -n "$HAPID" ] || {
@@ -162,9 +160,7 @@ waitexit 10000
162 EOF 160 EOF
163 RC=$? 161 RC=$?
164 set -e 162 set -e
165 [ "$RC" -eq 0 ] || { 163 rc0 "hosts: the empty-file leg exited $RC (did bare mux start a local daemon?):" "$OUT.hempty.log" "$OUT.hempty.err"
166 echo "e2e FAIL: hosts: the empty-file leg exited $RC (did bare mux start a local daemon?):"
167 cat "$OUT.hempty.log"; cat "$OUT.hempty.err" 2>/dev/null; exit 1; }
168 HEPID=$(sed -n 's/.* pid=\([0-9]*\).*/\1/p' "$OUT.hempty.err" | head -1) 164 HEPID=$(sed -n 's/.* pid=\([0-9]*\).*/\1/p' "$OUT.hempty.err" | head -1)
169 defer_kill "$HEPID" 165 defer_kill "$HEPID"
170 [ -n "$HEPID" ] || { 166 [ -n "$HEPID" ] || {
@@ -266,9 +262,7 @@ waitexit 15000
266 EOF 262 EOF
267 RC=$? 263 RC=$?
268 set -e 264 set -e
269 [ "$RC" -eq 0 ] || { 265 rc0 "hosts: the wall leg exited $RC (did every daemon's sessions become tiles?):" "$OUT.hwpc"
270 echo "e2e FAIL: hosts: the wall leg exited $RC (did every daemon's sessions become tiles?):"
271 cat "$OUT.hwpc"; exit 1; }
272 # Four bars, each naming its own daemon. 266 # Four bars, each naming its own daemon.
273 for _hl in "$SOCKH1#0" "$SOCKH1#b" "$SOCKH2#0" "$SOCKH2#c"; do 267 for _hl in "$SOCKH1#0" "$SOCKH1#b" "$SOCKH2#0" "$SOCKH2#c"; do
274 grep -q -- "--sock $_hl \[up\]" "$OUT.hwcap" || { 268 grep -q -- "--sock $_hl \[up\]" "$OUT.hwcap" || {
@@ -305,8 +299,7 @@ waitexit 15000
305 EOF 299 EOF
306 RC=$? 300 RC=$?
307 set -e 301 set -e
308 [ "$RC" -eq 0 ] || { 302 rc0 "hosts: the second wall exited $RC:" "$OUT.hw2pc"
309 echo "e2e FAIL: hosts: the second wall exited $RC:"; cat "$OUT.hw2pc"; exit 1; }
310 # `1` is the name `nextFreeName` picks on either daemon — both hold `0` and 303 # `1` is the name `nextFreeName` picks on either daemon — both hold `0` and
311 # one letter — so which host the birth landed on does not change what it is 304 # one letter — so which host the birth landed on does not change what it is
312 # called, only which stripe carries it. 305 # called, only which stripe carries it.
@@ -375,9 +368,7 @@ waitexit 10000
375 EOF 368 EOF
376 RC=$? 369 RC=$?
377 set -e 370 set -e
378 [ "$RC" -eq 0 ] || { 371 rc0 "hosts x: the refusal leg exited $RC (did the first x say who else was there?):" "$OUT.hx1pc"
379 echo "e2e FAIL: hosts x: the refusal leg exited $RC (did the first x say who else was there?):"
380 cat "$OUT.hx1pc"; exit 1; }
381 grep -qF -- "[1 other attached - x again to end]" "$OUT.hx1cap" || { 372 grep -qF -- "[1 other attached - x again to end]" "$OUT.hx1cap" || {
382 echo "e2e FAIL: hosts x: the refusal did not name the count:" 373 echo "e2e FAIL: hosts x: the refusal did not name the count:"
383 grep -ao '\[[0-9]* other[^]]*\]' "$OUT.hx1cap" | head -3; exit 1; } 374 grep -ao '\[[0-9]* other[^]]*\]' "$OUT.hx1cap" | head -3; exit 1; }
@@ -400,8 +391,7 @@ waitexit 10000
400 EOF 391 EOF
401 RC=$? 392 RC=$?
402 set -e 393 set -e
403 [ "$RC" -eq 0 ] || { 394 rc0 "hosts x: the forcing leg exited $RC:" "$OUT.hx2pc"
404 echo "e2e FAIL: hosts x: the forcing leg exited $RC:"; cat "$OUT.hx2pc"; exit 1; }
405 wait_pid_gone "$XBPID" "hosts x: the shell after the second x" 395 wait_pid_gone "$XBPID" "hosts x: the shell after the second x"
406 # The other client was hung up on, with the session's status in hand. 128 396 # The other client was hung up on, with the session's status in hand. 128
407 # is what a shell killed by a signal reports (pty.zig checkExited), and it 397 # is what a shell killed by a signal reports (pty.zig checkExited), and it
@@ -540,8 +530,7 @@ waitexit 15000
540 EOF 530 EOF
541 RC=$? 531 RC=$?
542 set -e 532 set -e
543 [ "$RC" -eq 0 ] || { 533 rc0 "hosts restart: the down-host wall exited $RC:" "$OUT.hdpc"
544 echo "e2e FAIL: hosts restart: the down-host wall exited $RC:"; cat "$OUT.hdpc"; exit 1; }
545 # The down daemon's two remembered panes on the SETTLED screen. The 534 # The down daemon's two remembered panes on the SETTLED screen. The
546 # `expect` above is the control: it waited on daemon 1's bar, so this grid 535 # `expect` above is the control: it waited on daemon 1's bar, so this grid
547 # is a PAINTED screen and not a blank one, and the settle past every 536 # is a PAINTED screen and not a blank one, and the settle past every
@@ -575,8 +564,7 @@ waitexit 15000
575 EOF 564 EOF
576 RC=$? 565 RC=$?
577 set -e 566 set -e
578 [ "$RC" -eq 0 ] || { 567 rc0 "hosts restart: the reborn-host wall exited $RC:" "$OUT.hrpc"
579 echo "e2e FAIL: hosts restart: the reborn-host wall exited $RC:"; cat "$OUT.hrpc"; exit 1; }
580 grep -q -- "--sock $SOCKH2#0 \[up\]" "$OUT.hrcap" || { 568 grep -q -- "--sock $SOCKH2#0 \[up\]" "$OUT.hrcap" || {
581 echo "e2e FAIL: hosts restart: the reborn daemon's own session never became a tile:" 569 echo "e2e FAIL: hosts restart: the reborn daemon's own session never became a tile:"
582 cat "$OUT.hrpc"; exit 1; } 570 cat "$OUT.hrpc"; exit 1; }
@@ -682,8 +670,7 @@ for _hh in "--help" "-h"; do
682 env XDG_STATE_HOME="$HSTATE" timeout 40 "$MUX" hosts "$_hh" > "$OUT.hhelp" 2>&1 670 env XDG_STATE_HOME="$HSTATE" timeout 40 "$MUX" hosts "$_hh" > "$OUT.hhelp" 2>&1
683 RC=$? 671 RC=$?
684 set -e 672 set -e
685 [ "$RC" -eq 0 ] || { 673 rc0 "hosts $_hh: exited $RC, want 0:" "$OUT.hhelp"
686 echo "e2e FAIL: hosts $_hh: exited $RC, want 0:"; cat "$OUT.hhelp"; exit 1; }
687 grep -q "mux hosts add SPELLING" "$OUT.hhelp" || { 674 grep -q "mux hosts add SPELLING" "$OUT.hhelp" || {
688 echo "e2e FAIL: hosts $_hh: answered something other than the usage:" 675 echo "e2e FAIL: hosts $_hh: answered something other than the usage:"
689 cat "$OUT.hhelp"; exit 1; } 676 cat "$OUT.hhelp"; exit 1; }
@@ -692,8 +679,7 @@ set +e
692 env XDG_STATE_HOME="$HSTATE" timeout 40 "$MUX" hosts --version > "$OUT.hver" 2>&1 679 env XDG_STATE_HOME="$HSTATE" timeout 40 "$MUX" hosts --version > "$OUT.hver" 2>&1
693 RC=$? 680 RC=$?
694 set -e 681 set -e
695 [ "$RC" -eq 0 ] || { 682 rc0 "hosts --version: exited $RC, want 0:" "$OUT.hver"
696 echo "e2e FAIL: hosts --version: exited $RC, want 0:"; cat "$OUT.hver"; exit 1; }
697 grep -q "^mux " "$OUT.hver" || { 683 grep -q "^mux " "$OUT.hver" || {
698 echo "e2e FAIL: hosts --version: did not name the binary and its version:" 684 echo "e2e FAIL: hosts --version: did not name the binary and its version:"
699 cat "$OUT.hver"; exit 1; } 685 cat "$OUT.hver"; exit 1; }
test/e2e_10_agent.sh
Old New
@@ -231,9 +231,7 @@ RC=$?
231 set -e 231 set -e
232 AR1=$(date +%s%N) 232 AR1=$(date +%s%N)
233 AMS=$(( (AR1 - AR0) / 1000000 )) 233 AMS=$(( (AR1 - AR0) / 1000000 ))
234 [ "$RC" -eq 0 ] || { 234 rc0 "agent-refusal: the leg exited $RC:" "$OUT.agtn.log"
235 echo "e2e FAIL: agent-refusal: the leg exited $RC:"
236 cat "$OUT.agtn.log"; exit 1; }
237 # Quoted heredoc, unlike the leg above: `$?` has to reach the SESSION's 235 # Quoted heredoc, unlike the leg above: `$?` has to reach the SESSION's
238 # shell as two characters, not be spent by this one. 236 # shell as two characters, not be spent by this one.
239 # 237 #
@@ -316,9 +314,7 @@ waitexit 10000
316 EOF 314 EOF
317 RC=$? 315 RC=$?
318 set -e 316 set -e
319 [ "$RC" -eq 0 ] || { 317 rc0 "agent-nested: the leg exited $RC:" "$OUT.agtnest.log"
320 echo "e2e FAIL: agent-nested: the leg exited $RC:"
321 cat "$OUT.agtnest.log"; exit 1; }
322 # Both needles are echo-proof: the typed line spells `nest=$?` and says 318 # Both needles are echo-proof: the typed line spells `nest=$?` and says
323 # nothing about ssh-agents, so neither `nest=2` nor the message below can 319 # nothing about ssh-agents, so neither `nest=2` nor the message below can
324 # come from the shell echoing what it was sent. 320 # come from the shell echoing what it was sent.
test/e2e_11_select.sh
Old New
@@ -72,9 +72,7 @@ waitexit 10000
72 EOF 72 EOF
73 RC=$? 73 RC=$?
74 set -e 74 set -e
75 [ "$RC" -eq 0 ] || { 75 rc0 "wall click: ptyclient leg exited $RC (did the click focus b?):" "$OUT.wmpc3"
76 echo "e2e FAIL: wall click: ptyclient leg exited $RC (did the click focus b?):"
77 cat "$OUT.wmpc3"; exit 1; }
78 timeout 20 "$MUX" a capture --sock "$SOCK50" > "$OUT.wmfa" 2>&1 76 timeout 20 "$MUX" a capture --sock "$SOCK50" > "$OUT.wmfa" 2>&1
79 timeout 20 "$MUX" a capture --sock "$SOCK50" --session b > "$OUT.wmfb" 2>&1 77 timeout 20 "$MUX" a capture --sock "$SOCK50" --session b > "$OUT.wmfb" 2>&1
80 grep -q "wm-three" "$OUT.wmfb" || { 78 grep -q "wm-three" "$OUT.wmfb" || {
@@ -105,9 +103,7 @@ waitexit 10000
105 EOF 103 EOF
106 RC=$? 104 RC=$?
107 set -e 105 set -e
108 [ "$RC" -eq 0 ] || { 106 rc0 "wall click: label-bar leg exited $RC:" "$OUT.wmpc4"
109 echo "e2e FAIL: wall click: label-bar leg exited $RC:"
110 cat "$OUT.wmpc4"; exit 1; }
111 timeout 20 "$MUX" a capture --sock "$SOCK50" > "$OUT.wmfa" 2>&1 107 timeout 20 "$MUX" a capture --sock "$SOCK50" > "$OUT.wmfa" 2>&1
112 timeout 20 "$MUX" a capture --sock "$SOCK50" --session b > "$OUT.wmfb" 2>&1 108 timeout 20 "$MUX" a capture --sock "$SOCK50" --session b > "$OUT.wmfb" 2>&1
113 grep -q "wm-four" "$OUT.wmfa" || { 109 grep -q "wm-four" "$OUT.wmfa" || {
@@ -140,9 +136,7 @@ waitexit 10000
140 EOF 136 EOF
141 RC=$? 137 RC=$?
142 set -e 138 set -e
143 [ "$RC" -eq 0 ] || { 139 rc0 "wall click: beside leg exited $RC (did the column click focus b?):" "$OUT.wmpc5"
144 echo "e2e FAIL: wall click: beside leg exited $RC (did the column click focus b?):"
145 cat "$OUT.wmpc5"; exit 1; }
146 timeout 20 "$MUX" a capture --sock "$SOCK50" > "$OUT.wmfa" 2>&1 140 timeout 20 "$MUX" a capture --sock "$SOCK50" > "$OUT.wmfa" 2>&1
147 timeout 20 "$MUX" a capture --sock "$SOCK50" --session b > "$OUT.wmfb" 2>&1 141 timeout 20 "$MUX" a capture --sock "$SOCK50" --session b > "$OUT.wmfb" 2>&1
148 grep -q "wm-five" "$OUT.wmfb" || { 142 grep -q "wm-five" "$OUT.wmfb" || {
@@ -194,9 +188,7 @@ waitexit 10000
194 EOF 188 EOF
195 RC=$? 189 RC=$?
196 set -e 190 set -e
197 [ "$RC" -eq 0 ] || { 191 rc0 "drag copy: ptyclient leg exited $RC (no OSC 52 with the dragged text?):" "$OUT.selpc"
198 echo "e2e FAIL: drag copy: ptyclient leg exited $RC (no OSC 52 with the dragged text?):"
199 cat "$OUT.selpc"; exit 1; }
200 # Exactly one copy on that tty, which is what makes the CLICK above a 192 # Exactly one copy on that tty, which is what makes the CLICK above a
201 # negative rather than decoration: a click highlights nothing, so it has 193 # negative rather than decoration: a click highlights nothing, so it has
202 # nothing to copy, and a client that copied on every button release would 194 # nothing to copy, and a client that copied on every button release would
@@ -306,8 +298,7 @@ waitexit 10000
306 EOF 298 EOF
307 RC=$? 299 RC=$?
308 set -e 300 set -e
309 [ "$RC" -eq 0 ] || { 301 rc0 "in-band size: the leg exited $RC:" "$OUT.inband.log"
310 echo "e2e FAIL: in-band size: the leg exited $RC:"; cat "$OUT.inband.log"; exit 1; }
311 assert_stopped "$SOCK51" "$D51PID" "in-band size" "$OUT.inbstop" 302 assert_stopped "$SOCK51" "$D51PID" "in-band size" "$OUT.inbstop"
312 D51PID="" 303 D51PID=""
313 ok "a resize is reported in-band to an app that turned on mode 2048" 304 ok "a resize is reported in-band to an app that turned on mode 2048"
@@ -420,9 +411,7 @@ grep -q "mute1=124" "$OUT.agtmute" && {
420 echo "e2e FAIL: agent-mute: the first ssh-add wedged for the whole 8s — the" 411 echo "e2e FAIL: agent-mute: the first ssh-add wedged for the whole 8s — the"
421 echo " daemon never hung up on the client that would not answer:" 412 echo " daemon never hung up on the client that would not answer:"
422 cat -v "$OUT.agtmute"; exit 1; } 413 cat -v "$OUT.agtmute"; exit 1; }
423 [ "$RC" -eq 0 ] || { 414 rc0 "agent-mute: the leg exited $RC:" "$OUT.agtmute.log"
424 echo "e2e FAIL: agent-mute: the leg exited $RC:"
425 cat "$OUT.agtmute.log"; exit 1; }
426 grep -qE "mute1=[1-9]" "$OUT.agtmute" || { 415 grep -qE "mute1=[1-9]" "$OUT.agtmute" || {
427 echo "e2e FAIL: agent-mute: the first ssh-add did not fail at all — something" 416 echo "e2e FAIL: agent-mute: the first ssh-add did not fail at all — something"
428 echo " answered for a stopped agent:" 417 echo " answered for a stopped agent:"
test/e2e_12_panes.sh
Old New
@@ -94,9 +94,7 @@ waitexit 10000
94 EOF 94 EOF
95 RC=$? 95 RC=$?
96 set -e 96 set -e
97 [ "$RC" -eq 0 ] || { 97 rc0 "cursor-ownership: ptyclient leg exited $RC:" "$OUT.cupc" "$OUT.cucap.err"
98 echo "e2e FAIL: cursor-ownership: ptyclient leg exited $RC:"
99 cat "$OUT.cupc" "$OUT.cucap.err"; exit 1; }
100 # WHICH rows tile 3's stripe owns is read off the capture rather than 98 # WHICH rows tile 3's stripe owns is read off the capture rather than
101 # counted. A host's list arrives in the daemon's slot order and is laid out 99 # counted. A host's list arrives in the daemon's slot order and is laid out
102 # in that order, so the third digit IS the third stripe down — but that is 100 # in that order, so the third digit IS the third stripe down — but that is
@@ -184,9 +182,7 @@ waitexit 10000
184 EOF 182 EOF
185 RC=$? 183 RC=$?
186 set -e 184 set -e
187 [ "$RC" -eq 0 ] || { 185 rc0 "scrollback-rect: ptyclient leg exited $RC (did the focused wheel scroll?):" "$OUT.sb2pc"
188 echo "e2e FAIL: scrollback-rect: ptyclient leg exited $RC (did the focused wheel scroll?):"
189 cat "$OUT.sb2pc"; exit 1; }
190 # The neighbour's pin is still the last content painted in its rows: the 186 # The neighbour's pin is still the last content painted in its rows: the
191 # capture holds it, and nothing after it cleared the whole screen. A 187 # capture holds it, and nothing after it cleared the whole screen. A
192 # scrollback page that owned the whole terminal (the bug) would open with 188 # scrollback page that owned the whole terminal (the bug) would open with
@@ -252,9 +248,7 @@ waitexit 10000
252 EOF 248 EOF
253 RC=$? 249 RC=$?
254 set -e 250 set -e
255 [ "$RC" -eq 0 ] || { 251 rc0 "fullscreen: ptyclient leg exited $RC:" "$OUT.fspc" "$OUT.fscap.err"
256 echo "e2e FAIL: fullscreen: ptyclient leg exited $RC:"
257 cat "$OUT.fspc" "$OUT.fscap.err"; exit 1; }
258 # fs-one landed in session a (the tile that was fullscreened first); 252 # fs-one landed in session a (the tile that was fullscreened first);
259 # fs-two landed in session b (the tile Ctrl-\ 2 moved the full rect to). 253 # fs-two landed in session b (the tile Ctrl-\ 2 moved the full rect to).
260 timeout 20 "$MUX" a capture --sock "$SOCK54" > "$OUT.fsfa" 2>&1 254 timeout 20 "$MUX" a capture --sock "$SOCK54" > "$OUT.fsfa" 2>&1
@@ -341,9 +335,7 @@ waitexit 10000
341 EOF 335 EOF
342 RC=$? 336 RC=$?
343 set -e 337 set -e
344 [ "$RC" -eq 0 ] || { 338 rc0 "resize: ptyclient leg exited $RC:" "$OUT.rszpc" "$OUT.rszcap.err"
345 echo "e2e FAIL: resize: ptyclient leg exited $RC:"
346 cat "$OUT.rszpc" "$OUT.rszcap.err"; exit 1; }
347 # The rail paints as ESC[row;colH followed by ESC[7m (reverse video). 339 # The rail paints as ESC[row;colH followed by ESC[7m (reverse video).
348 # Extract the column from every CUP that precedes a reverse-video 340 # Extract the column from every CUP that precedes a reverse-video
349 # space — the rail's column — and verify it moved right by 3. 341 # space — the rail's column — and verify it moved right by 3.
@@ -409,9 +401,7 @@ waitexit 10000
409 EOF 401 EOF
410 RC=$? 402 RC=$?
411 set -e 403 set -e
412 [ "$RC" -eq 0 ] || { 404 rc0 "span-clear: ptyclient leg exited $RC:" "$OUT.spcpc" "$OUT.spccap.err"
413 echo "e2e FAIL: span-clear: ptyclient leg exited $RC:"
414 cat "$OUT.spcpc" "$OUT.spccap.err"; exit 1; }
415 # The oracle: replay the captured stream through the render fixture at the 405 # The oracle: replay the captured stream through the render fixture at the
416 # same dimensions, producing the final grid text. The right pane's marker 406 # same dimensions, producing the final grid text. The right pane's marker
417 # must still be on that grid — a span-clear regression blanks it. 407 # must still be on that grid — a span-clear regression blanks it.
@@ -476,9 +466,7 @@ waitexit 10000
476 EOF 466 EOF
477 RC=$? 467 RC=$?
478 set -e 468 set -e
479 [ "$RC" -eq 0 ] || { 469 rc0 "hjkl: ptyclient leg exited $RC:" "$OUT.hjkpc" "$OUT.hjkcap.err"
480 echo "e2e FAIL: hjkl: ptyclient leg exited $RC:"
481 cat "$OUT.hjkpc" "$OUT.hjkcap.err"; exit 1; }
482 # Three sessions exist now: a (the origin), and two birthed by splits. 470 # Three sessions exist now: a (the origin), and two birthed by splits.
483 # The daemon assigns numeric names to the new sessions; capture all three. 471 # The daemon assigns numeric names to the new sessions; capture all three.
484 timeout 20 "$MUX" a capture --sock "$SOCK57" > "$OUT.hjkfa" 2>&1 472 timeout 20 "$MUX" a capture --sock "$SOCK57" > "$OUT.hjkfa" 2>&1
@@ -530,9 +518,7 @@ waitexit 10000
530 EOF 518 EOF
531 RC=$? 519 RC=$?
532 set -e 520 set -e
533 [ "$RC" -eq 0 ] || { 521 rc0 "split-birth: ptyclient leg exited $RC:" "$OUT.splpc" "$OUT.splcap.err"
534 echo "e2e FAIL: split-birth: ptyclient leg exited $RC:"
535 cat "$OUT.splpc" "$OUT.splcap.err"; exit 1; }
536 # The daemon held its own default session and nothing else; the split 522 # The daemon held its own default session and nothing else; the split
537 # birthed one more, so two live sessions proves the chord created one. 523 # birthed one more, so two live sessions proves the chord created one.
538 wait_sessions "$SOCK58" 2 "split-birth: split did not birth a new session" 524 wait_sessions "$SOCK58" 2 "split-birth: split did not birth a new session"
@@ -615,9 +601,7 @@ waitexit 10000
615 EOF 601 EOF
616 RC=$? 602 RC=$?
617 set -e 603 set -e
618 [ "$RC" -eq 0 ] || { 604 rc0 "layout-restore: first ptyclient exited $RC:" "$OUT.lprpc1" "$OUT.lprcap1.err"
619 echo "e2e FAIL: layout-restore: first ptyclient exited $RC:"
620 cat "$OUT.lprpc1" "$OUT.lprcap1.err"; exit 1; }
621 605
622 # The sidecar exists and its header is the format the spec mandates. 606 # The sidecar exists and its header is the format the spec mandates.
623 [ -f "$LPLAYOUT" ] || { 607 [ -f "$LPLAYOUT" ] || {
@@ -655,9 +639,7 @@ waitexit 10000
655 EOF 639 EOF
656 RC=$? 640 RC=$?
657 set -e 641 set -e
658 [ "$RC" -eq 0 ] || { 642 rc0 "layout-restore: second ptyclient exited $RC:" "$OUT.lprpc2" "$OUT.lprcap2.err"
659 echo "e2e FAIL: layout-restore: second ptyclient exited $RC:"
660 cat "$OUT.lprpc2" "$OUT.lprcap2.err"; exit 1; }
661 # The rail's CUP column in the second capture must be >= 43 — three 643 # The rail's CUP column in the second capture must be >= 43 — three
662 # right-resizes moved the boundary from 41 to 44. 644 # right-resizes moved the boundary from 41 to 44.
663 _max_rail=$(rail_cols "$OUT.lprcap2" | tail -1) 645 _max_rail=$(rail_cols "$OUT.lprcap2" | tail -1)
@@ -754,9 +736,7 @@ waitexit 10000
754 EOF 736 EOF
755 RC=$? 737 RC=$?
756 set -e 738 set -e
757 [ "$RC" -eq 0 ] || { 739 rc0 "layout-heal: first ptyclient exited $RC:" "$OUT.lphpc1" "$OUT.lphcap1.err"
758 echo "e2e FAIL: layout-heal: first ptyclient exited $RC:"
759 cat "$OUT.lphpc1" "$OUT.lphcap1.err"; exit 1; }
760 [ -f "$LPHLAYOUT" ] || { 740 [ -f "$LPHLAYOUT" ] || {
761 echo "e2e FAIL: layout-heal: sidecar not saved after first detach" 741 echo "e2e FAIL: layout-heal: sidecar not saved after first detach"
762 ls -la "$LPHSTATE/mux/" 2>&1; exit 1; } 742 ls -la "$LPHSTATE/mux/" 2>&1; exit 1; }
@@ -792,9 +772,7 @@ waitexit 10000
792 EOF 772 EOF
793 RC=$? 773 RC=$?
794 set -e 774 set -e
795 [ "$RC" -eq 0 ] || { 775 rc0 "layout-heal: second ptyclient exited $RC:" "$OUT.lphpc2" "$OUT.lphcap2.err"
796 echo "e2e FAIL: layout-heal: second ptyclient exited $RC:"
797 cat "$OUT.lphpc2" "$OUT.lphcap2.err"; exit 1; }
798 # The wall must not have refused: the ptyclient exited 0 (checked above), 776 # The wall must not have refused: the ptyclient exited 0 (checked above),
799 # and stderr mentions no layout error. 777 # and stderr mentions no layout error.
800 grep -qi "layout" "$OUT.lphcap2.err" && { 778 grep -qi "layout" "$OUT.lphcap2.err" && {
@@ -892,9 +870,7 @@ waitexit 10000
892 EOF 870 EOF
893 RC=$? 871 RC=$?
894 set -e 872 set -e
895 [ "$RC" -eq 0 ] || { 873 rc0 "layout-degrade: ptyclient exited $RC:" "$OUT.lpdpc" "$OUT.lpdcap.err"
896 echo "e2e FAIL: layout-degrade: ptyclient exited $RC:"
897 cat "$OUT.lpdpc" "$OUT.lpdcap.err"; exit 1; }
898 # The wall came up: the marker reached the focused session. 874 # The wall came up: the marker reached the focused session.
899 timeout 20 "$MUX" a capture --sock "$SOCK61" > "$OUT.lpdfa" 2>&1 875 timeout 20 "$MUX" a capture --sock "$SOCK61" > "$OUT.lpdfa" 2>&1
900 grep -q "lpd-degrade-marker" "$OUT.lpdfa" || { 876 grep -q "lpd-degrade-marker" "$OUT.lpdfa" || {
@@ -965,9 +941,7 @@ waitexit 10000
965 EOF 941 EOF
966 RC=$? 942 RC=$?
967 set -e 943 set -e
968 [ "$RC" -eq 0 ] || { 944 rc0 "gone-panes: run 1's ptyclient exited $RC:" "$OUT.gppc1" "$OUT.gpcap1.err"
969 echo "e2e FAIL: gone-panes: run 1's ptyclient exited $RC:"
970 cat "$OUT.gppc1" "$OUT.gpcap1.err"; exit 1; }
971 [ -f "$GPLAYOUT" ] || { 945 [ -f "$GPLAYOUT" ] || {
972 echo "e2e FAIL: gone-panes: sidecar not saved at $GPLAYOUT" 946 echo "e2e FAIL: gone-panes: sidecar not saved at $GPLAYOUT"
973 ls -la "$GPSTATE/mux/" 2>&1; exit 1; } 947 ls -la "$GPSTATE/mux/" 2>&1; exit 1; }
@@ -1016,9 +990,7 @@ waitexit 10000
1016 EOF 990 EOF
1017 RC=$? 991 RC=$?
1018 set -e 992 set -e
1019 [ "$RC" -eq 0 ] || { 993 rc0 "gone-panes: run 2's ptyclient exited $RC:" "$OUT.gppc2" "$OUT.gpcap2.err"
1020 echo "e2e FAIL: gone-panes: run 2's ptyclient exited $RC:"
1021 cat "$OUT.gppc2" "$OUT.gpcap2.err"; exit 1; }
1022 # The word reached the grid. A bar is byte-truncated from the LABEL end and 994 # The word reached the grid. A bar is byte-truncated from the LABEL end and
1023 # the state survives that cut (`labelText`), so `[gone]` is on screen for 995 # the state survives that cut (`labelText`), so `[gone]` is on screen for
1024 # any pane width this leg could produce. 996 # any pane width this leg could produce.
@@ -1069,9 +1041,7 @@ waitexit 10000
1069 EOF 1041 EOF
1070 RC=$? 1042 RC=$?
1071 set -e 1043 set -e
1072 [ "$RC" -eq 0 ] || { 1044 rc0 "gone-panes: run 3's ptyclient exited $RC:" "$OUT.gppc3" "$OUT.gpcap3.err"
1073 echo "e2e FAIL: gone-panes: run 3's ptyclient exited $RC:"
1074 cat "$OUT.gppc3" "$OUT.gpcap3.err"; exit 1; }
1075 # The revived session is REAL and carries the name its pane remembered: 1045 # The revived session is REAL and carries the name its pane remembered:
1076 # the daemon's own grid for `b` holds the marker, and the entry session 1046 # the daemon's own grid for `b` holds the marker, and the entry session
1077 # does not — a revive that created `0` again, or created nothing and typed 1047 # does not — a revive that created `0` again, or created nothing and typed
test/e2e_13_birth.sh
Old New
@@ -113,9 +113,7 @@ waitexit 10000
113 EOF 113 EOF
114 RC=$? 114 RC=$?
115 set -e 115 set -e
116 [ "$RC" -eq 0 ] || { 116 rc0 "prompt: ptyclient leg exited $RC (did the picker's a add the tile?):" "$OUT.prpc" "$OUT.prcap.err"
117 echo "e2e FAIL: prompt: ptyclient leg exited $RC (did the picker's a add the tile?):"
118 cat "$OUT.prpc" "$OUT.prcap.err"; exit 1; }
119 # The oracle, not the byte stream: a banner LEFT on the screen is invisible 117 # The oracle, not the byte stream: a banner LEFT on the screen is invisible
120 # to a grep of the emitted bytes — the `: zzz` that painted is in the 118 # to a grep of the emitted bytes — the `: zzz` that painted is in the
121 # capture either way. Only the render's final grid says what the human was 119 # capture either way. Only the render's final grid says what the human was
test/e2e_lib.sh
Old New
@@ -249,6 +249,21 @@ case "${E2E_STOP_AFTER:-1}" in
249 ''|*[!0-9]*) echo "e2e FAIL: E2E_STOP_AFTER must be a positive integer"; exit 1 ;; 249 ''|*[!0-9]*) echo "e2e FAIL: E2E_STOP_AFTER must be a positive integer"; exit 1 ;;
250 esac 250 esac
251 251
252 # rc0 MESSAGE [FILE...] — the assert under a `set +e … RC=$? … set -e`
253 # capture: RC must be 0 or the suite fails, printing MESSAGE and then the
254 # FILEs. MESSAGE is the caller's own prose and already holds $RC wherever
255 # it wants it — rc0 appends no "(rc N)" of its own, because the sites this
256 # replaced carry rc legends ("134 = panic, 124 = hung") in positions no
257 # fixed suffix could reproduce. Only the plain rc==0 shape converts to
258 # this; a block that compares RC to a specific value, kills something, or
259 # dumps state on the way out keeps its bespoke form.
260 rc0() {
261 [ "$RC" -eq 0 ] && return 0
262 echo "e2e FAIL: $1"; shift
263 for _f in "$@"; do cat "$_f" 2>/dev/null; done
264 exit 1
265 }
266
252 wait_for() { 267 wait_for() {
253 _file="$1"; _pat="$2"; _ticks=$(( ${3:-15} * 10 * TIME_SCALE )); _i=0 268 _file="$1"; _pat="$2"; _ticks=$(( ${3:-15} * 10 * TIME_SCALE )); _i=0
254 while [ "$_i" -lt "$_ticks" ]; do 269 while [ "$_i" -lt "$_ticks" ]; do