Serialize display recovery checks
This commit is contained in:
@@ -225,8 +225,24 @@ KINDS
|
||||
now="$(status)"
|
||||
[[ "$(jq -r .scale <<<"$now")" == "$original_scale" ]] || fail 'a refused change still altered the scale'
|
||||
|
||||
# ── An unconfirmed change reverts on its own and stores nothing ──────────────
|
||||
# An immediate Revert may race both the apply process and its first readback.
|
||||
# It must queue until both are clear, then verify the original generation.
|
||||
target_scale=$(awk -v s="$original_scale" 'BEGIN { print (s == 1.25) ? 1.5 : 1.25 }')
|
||||
[[ "$(run ipc call displays-test applyScale "$target_scale")" == "true" ]] \
|
||||
|| fail 'the immediate-revert fixture could not apply'
|
||||
run ipc call displays-test revertChange >/dev/null
|
||||
immediate_reverted=false
|
||||
for _ in $(seq 1 60); do
|
||||
if display_is_restored && [[ "$(status | jq -r .awaiting)" == "false" ]]; then
|
||||
immediate_reverted=true
|
||||
break
|
||||
fi
|
||||
sleep 0.2
|
||||
done
|
||||
[[ "$immediate_reverted" == true ]] \
|
||||
|| fail 'an immediate Revert raced the apply/readback and did not restore the display'
|
||||
|
||||
# ── An unconfirmed change reverts on its own and stores nothing ──────────────
|
||||
[[ "$(run ipc call displays-test applyScale "$target_scale")" == "true" ]] \
|
||||
|| fail 'a valid scale change was refused'
|
||||
|
||||
|
||||
Reference in New Issue
Block a user