aboutsummaryrefslogtreecommitdiff
path: root/tests/e2e.sh
diff options
context:
space:
mode:
authorIgor Soarez <igor@soarez.org>2026-10-23 14:07:15 +0300
committerIgor Soarez <igor@soarez.org>2026-10-23 14:07:15 +0300
commita7d34521c7f874beb44e0314017ab28979550495 (patch)
treec08f78e7e54dee869ec09f2d6d2d5522d3c9d8a1 /tests/e2e.sh
parente05ad549b38b522fabaa8f9c1f0c4b08aa5a0869 (diff)
write a pane's options in one tmux command list
the watcher wrote @agent_state, then @dingger_hook, as separate tmux calls. a daemon stopped between them left a done display state next to a stale "working" hook state, which the restarted daemon trusted: the agent came back as working. now every changed option of a pane is one command list, which tmux applies as a unit (and one process instead of several). tests/kill-race.sh kills the daemon the instant an agent shows done: 24 of 40 kills left the options inconsistent before, 0 of 40 now. e2e step 17 runs it 20 times; the previous binary fails it.
Diffstat (limited to 'tests/e2e.sh')
-rwxr-xr-xtests/e2e.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/e2e.sh b/tests/e2e.sh
index b79c748..26914f1 100755
--- a/tests/e2e.sh
+++ b/tests/e2e.sh
@@ -519,6 +519,11 @@ sleep 2
expect "it stays dismissed when a terminal starts tmux" "ls $STATE2/offer.json 2>/dev/null | wc -l | tr -d ' '" 0
expect "the layout can still be restored by hand" "renv \"$DINGGER\" restore --dry-run | grep -c '^create keep'" 1
+# --- 17. a daemon killed mid-write leaves consistent state -------------------
+echo "17. kill during a write"
+expect "20 kills right after done: hook and display state agree" \
+ "\"$ROOT/tests/kill-race.sh\" \"$DINGGER\" 20 | grep -o '^[^:]*: [0-9]* of' | sed 's/.*: //'" "0 of" 1
+
# Every daemon this run started must stop with it.
kill "$DAEMON_PID" "$DAEMON2_PID" 2>/dev/null
expect "the test daemons stop" "ps -o pid= -p $DAEMON_PID,$DAEMON2_PID | wc -l | tr -d ' '" 0