From 63f4bdb5478e06275158a28b501cb678ee85b4a5 Mon Sep 17 00:00:00 2001 From: Gabriel Brown Date: Tue, 18 Aug 2026 15:32:59 -0400 Subject: [PATCH] Make display confirmation test deterministic --- tests/quickshell/display-transaction-contract.sh | 2 ++ tests/quickshell/displays-contract.sh | 11 ++++++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/quickshell/display-transaction-contract.sh b/tests/quickshell/display-transaction-contract.sh index 5b181da..d13cf57 100755 --- a/tests/quickshell/display-transaction-contract.sh +++ b/tests/quickshell/display-transaction-contract.sh @@ -209,6 +209,8 @@ stale_json="$(jq '.[1].y = 250' "$monitor_state")" run ipc --pid "$harness_pid" call displays-test injectReadback "$stale_json" "$((generation - 1))" >/dev/null jq -e '.canConfirm == false' <<<"$(transaction_status)" >/dev/null \ || fail 'stale readback confirmed a newer operation' +[[ "$(run ipc --pid "$harness_pid" call displays-test confirmChange)" == "false" ]] \ + || fail 'Keep accepted a display change without a generation-matched readback' rm -f "$fixture/no-apply" run ipc --pid "$harness_pid" call displays-test expireApplyVerification >/dev/null wait_for '.busy == false and .awaiting == false' >/dev/null diff --git a/tests/quickshell/displays-contract.sh b/tests/quickshell/displays-contract.sh index 9bf39bf..6ea3364 100755 --- a/tests/quickshell/displays-contract.sh +++ b/tests/quickshell/displays-contract.sh @@ -335,9 +335,14 @@ done [[ "$(status | jq -r .overridden)" == "false" ]] || fail 'an unconfirmed change was written to the settings store' # ── A confirmed change is what writes ──────────────────────────────────────── -run ipc call displays-test applyScale "$target_scale" >/dev/null -[[ "$(run ipc call displays-test confirmChange)" == "false" ]] \ - || fail 'Keep accepted a display change before compositor readback' +[[ "$(run ipc call displays-test applyScale "$target_scale")" == "true" ]] \ + || fail 'the confirmed-change fixture could not apply' + +# Hyprland can apply and read back a change faster than two IPC round trips, so +# this live test cannot reliably observe the pre-readback state. The +# fake-compositor contract deterministically holds that boundary open and +# proves Keep refuses it; this path proves a real readback eventually enables +# and persists Keep on the physical display. verified=false for _ in $(seq 1 30); do [[ "$(status | jq -r .canConfirm)" == "true" ]] && { verified=true; break; }