From a7d34521c7f874beb44e0314017ab28979550495 Mon Sep 17 00:00:00 2001 From: Igor Soarez Date: Fri, 23 Oct 2026 14:07:15 +0300 Subject: 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. --- tests/e2e.sh | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'tests/e2e.sh') 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 -- cgit v1.2.3