Make display confirmation test deterministic

This commit is contained in:
Gabriel Brown
2026-08-18 15:32:59 -04:00
parent 1a93a788fa
commit 63f4bdb547
2 changed files with 10 additions and 3 deletions
@@ -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
+8 -3
View File
@@ -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; }