f1d908b5
test: the hidden-tile leg pins silence, not a repaint schedule
a73x 2026-08-20 10:58
Commit message
test/e2e.sh
| Old | New | ||
|---|---|---|---|
| @@ -6104,14 +6104,21 @@ ok "an application in a zoomed tile gets the wheel, and the tile does not" | |||
| 6104 | # shell — typed at, through the zoom — that creates the flag. So the | 6104 | # shell — typed at, through the zoom — that creates the flag. So the |
| 6105 | # hidden tile's output happens strictly INSIDE the zoom, with no sleep | 6105 | # hidden tile's output happens strictly INSIDE the zoom, with no sleep |
| 6106 | # to race and no ordering to hope for. | 6106 | # to race and no ordering to hope for. |
| 6107 | # * `bhidden-pin` must therefore appear exactly ONCE in this terminal's | 6107 | # * the capture is then SPLIT at `zhzoom-ok`, which the zoomed session |
| 6108 | # whole life: the stripe repaint after the unzoom, from the replica that | 6108 | # prints immediately before the unzoom chord. Before that split |
| 6109 | # was hot the entire time. A second occurrence is the hidden tile having | 6109 | # `bhidden-pin` must appear ZERO times — that is "silent while hidden", |
| 6110 | # painted over the session the user was typing at. | 6110 | # stated exactly. After it, at least once: the stripe repaint from the |
| 6111 | # | 6111 | # replica that was hot the entire time, which is also what proves the |
| 6112 | # The zoomed session gets its own marker in between, so a leg that lost the | 6112 | # hidden session really did have something to say. |
| 6113 | # zoom (and would then pass the count for the wrong reason) fails loudly on | 6113 | # |
| 6114 | # the expect instead. | 6114 | # What is deliberately NOT pinned is the count after the unzoom. A demoted |
| 6115 | # tile has two legal paint paths — a frame arriving, and `repaint_gen` — so a | ||
| 6116 | # second stripe paint is a repaint schedule rather than a broken invariant, | ||
| 6117 | # and pinning it to one failed this leg about three runs in five. | ||
| 6118 | # | ||
| 6119 | # The zoomed session's own marker is therefore load-bearing twice: it is the | ||
| 6120 | # split point, and a leg that lost the zoom fails loudly on its expect | ||
| 6121 | # instead of passing the count for the wrong reason. | ||
| 6115 | cat > "$ZHASH" <<'EOF' | 6122 | cat > "$ZHASH" <<'EOF' |
| 6116 | #!/bin/sh | 6123 | #!/bin/sh |
| 6117 | printf 'zha-%s\n' pin | 6124 | printf 'zha-%s\n' pin |
| @@ -6177,12 +6184,28 @@ set -e | |||
| 6177 | cat "$OUT.zhpc"; exit 1; } | 6184 | cat "$OUT.zhpc"; exit 1; } |
| 6178 | # The money assertion. `grep -o`, not `grep -c`: a stripe paint is escape | 6185 | # The money assertion. `grep -o`, not `grep -c`: a stripe paint is escape |
| 6179 | # sequences with no newlines in them, so a line count reads 1 either way. | 6186 | # sequences with no newlines in them, so a line count reads 1 either way. |
| 6180 | _zh_paints=$(grep -oa "bhidden-pin" "$OUT.zhcap" | wc -l) | 6187 | # |
| 6181 | [ "$_zh_paints" -eq 1 ] || { | 6188 | # Which is also why the split is a BYTE offset and not `sed '1,/marker/p'`: |
| 6189 | # the same absent newlines make this whole capture one enormous line, so a | ||
| 6190 | # line-addressed split hands back the entire file and the "before" half | ||
| 6191 | # quietly becomes the whole run. | ||
| 6192 | _zh_off=$(grep -oab "zhzoom-ok" "$OUT.zhcap" | head -1 | cut -d: -f1) | ||
| 6193 | [ -n "$_zh_off" ] || { | ||
| 6194 | echo "e2e FAIL: hidden tile: the zoomed session's marker is not in the capture," | ||
| 6195 | echo " so there is no before/after to split on:" | ||
| 6196 | cat "$OUT.zhpc"; exit 1; } | ||
| 6197 | _zh_pre=$(head -c "$_zh_off" "$OUT.zhcap" | grep -oa "bhidden-pin" | wc -l) | ||
| 6198 | _zh_post=$(tail -c "+$((_zh_off + 1))" "$OUT.zhcap" | grep -oa "bhidden-pin" | wc -l) | ||
| 6199 | [ "$_zh_pre" -eq 0 ] || { | ||
| 6182 | echo "e2e FAIL: hidden tile: the hidden session's marker reached this terminal" | 6200 | echo "e2e FAIL: hidden tile: the hidden session's marker reached this terminal" |
| 6183 | echo " $_zh_paints time(s); exactly one — the stripe repaint after the" | 6201 | echo " $_zh_pre time(s) WHILE THE ZOOM WAS UP; a tile the zoom is not" |
| 6184 | echo " unzoom — is the whole budget, and the rest is a tile painting" | 6202 | echo " on is silent, and that is a tile painting over the session the" |
| 6185 | echo " over the session the user was typing at:" | 6203 | echo " user was typing at:" |
| 6204 | cat "$OUT.zhpc"; exit 1; } | ||
| 6205 | [ "$_zh_post" -ge 1 ] || { | ||
| 6206 | echo "e2e FAIL: hidden tile: the marker never reached this terminal after the" | ||
| 6207 | echo " unzoom, so the stripe repaint from the hot replica never" | ||
| 6208 | echo " happened and the silence above proves nothing:" | ||
| 6186 | cat "$OUT.zhpc"; exit 1; } | 6209 | cat "$OUT.zhpc"; exit 1; } |
| 6187 | assert_stopped "$SOCK43" "$D40PID" "hidden tile A" "$OUT.zhstopa" | 6210 | assert_stopped "$SOCK43" "$D40PID" "hidden tile A" "$OUT.zhstopa" |
| 6188 | D40PID="" | 6211 | D40PID="" |