Make display confirmation test deterministic
This commit is contained in:
@@ -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
|
run ipc --pid "$harness_pid" call displays-test injectReadback "$stale_json" "$((generation - 1))" >/dev/null
|
||||||
jq -e '.canConfirm == false' <<<"$(transaction_status)" >/dev/null \
|
jq -e '.canConfirm == false' <<<"$(transaction_status)" >/dev/null \
|
||||||
|| fail 'stale readback confirmed a newer operation'
|
|| 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"
|
rm -f "$fixture/no-apply"
|
||||||
run ipc --pid "$harness_pid" call displays-test expireApplyVerification >/dev/null
|
run ipc --pid "$harness_pid" call displays-test expireApplyVerification >/dev/null
|
||||||
wait_for '.busy == false and .awaiting == false' >/dev/null
|
wait_for '.busy == false and .awaiting == false' >/dev/null
|
||||||
|
|||||||
@@ -335,9 +335,14 @@ done
|
|||||||
[[ "$(status | jq -r .overridden)" == "false" ]] || fail 'an unconfirmed change was written to the settings store'
|
[[ "$(status | jq -r .overridden)" == "false" ]] || fail 'an unconfirmed change was written to the settings store'
|
||||||
|
|
||||||
# ── A confirmed change is what writes ────────────────────────────────────────
|
# ── A confirmed change is what writes ────────────────────────────────────────
|
||||||
run ipc call displays-test applyScale "$target_scale" >/dev/null
|
[[ "$(run ipc call displays-test applyScale "$target_scale")" == "true" ]] \
|
||||||
[[ "$(run ipc call displays-test confirmChange)" == "false" ]] \
|
|| fail 'the confirmed-change fixture could not apply'
|
||||||
|| fail 'Keep accepted a display change before compositor readback'
|
|
||||||
|
# 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
|
verified=false
|
||||||
for _ in $(seq 1 30); do
|
for _ in $(seq 1 30); do
|
||||||
[[ "$(status | jq -r .canConfirm)" == "true" ]] && { verified=true; break; }
|
[[ "$(status | jq -r .canConfirm)" == "true" ]] && { verified=true; break; }
|
||||||
|
|||||||
Reference in New Issue
Block a user