Stop the compositor write contract failing under load
It passed alone in two seconds and failed in a full suite run at six, which is the worst way for a test to be wrong: the code was fine and the report said otherwise. Each of its waits polls until the compositor reflects a write, and four seconds was enough on an idle machine and not enough on a busy one. They are fifteen now. A longer bound cannot mask a dead write, because a write that never lands never matches -- verified by stubbing the write path out and watching it still report exactly which policy failed. Claude-Session: https://claude.ai/code/session_01BRvzt4H8XXLPVH5MyYdk9L
This commit is contained in:
@@ -104,7 +104,13 @@ done
|
|||||||
|| fail 'another instance of the settings harness is still running -- this contract would talk to it instead of its own, and its writes may be deliberately stubbed'
|
|| fail 'another instance of the settings harness is still running -- this contract would talk to it instead of its own, and its writes may be deliberately stubbed'
|
||||||
|
|
||||||
XDG_CONFIG_HOME="$config_home" qs -p "$harness" --daemonize >/dev/null
|
XDG_CONFIG_HOME="$config_home" qs -p "$harness" --daemonize >/dev/null
|
||||||
for _ in $(seq 1 40); do
|
# Bounded waits are deliberately generous. Each of these polls until the
|
||||||
|
# compositor reflects a write, and four seconds was enough on an idle machine
|
||||||
|
# and not enough on a busy one -- this contract passed alone and failed in a
|
||||||
|
# full suite run, which is the worst way for a test to be wrong. A longer bound
|
||||||
|
# cannot mask a dead write, because a write that never lands never matches; it
|
||||||
|
# only stops a slow one from being reported as a broken one.
|
||||||
|
for _ in $(seq 1 150); do
|
||||||
if qs_for_harness ipc show 2>/dev/null | rg -q '^target settings-system-test$'; then
|
if qs_for_harness ipc show 2>/dev/null | rg -q '^target settings-system-test$'; then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
@@ -116,7 +122,7 @@ qs_for_harness ipc show 2>/dev/null | rg -q '^target settings-system-test$' || f
|
|||||||
qs_for_harness ipc call settings-system-test apply "$target_auto_hdr" "$target_vrr" "$target_direct" >/dev/null
|
qs_for_harness ipc call settings-system-test apply "$target_auto_hdr" "$target_vrr" "$target_direct" >/dev/null
|
||||||
|
|
||||||
applied=false
|
applied=false
|
||||||
for _ in $(seq 1 40); do
|
for _ in $(seq 1 150); do
|
||||||
if [[ "$(read_option render:cm_auto_hdr)" == "$target_auto_hdr_int" \
|
if [[ "$(read_option render:cm_auto_hdr)" == "$target_auto_hdr_int" \
|
||||||
&& "$(read_option misc:vrr)" == "$target_vrr" \
|
&& "$(read_option misc:vrr)" == "$target_vrr" \
|
||||||
&& "$(read_option render:direct_scanout)" == "$target_direct" ]]; then
|
&& "$(read_option render:direct_scanout)" == "$target_direct" ]]; then
|
||||||
@@ -143,7 +149,7 @@ qs_for_harness ipc call settings-system-test apply "$target_auto_hdr" 7 "$target
|
|||||||
# reporting "a rejected value did not surface an error" when the error simply
|
# reporting "a rejected value did not surface an error" when the error simply
|
||||||
# had not arrived yet -- which reads as a missing guard rather than a slow one.
|
# had not arrived yet -- which reads as a missing guard rather than a slow one.
|
||||||
rejected=""
|
rejected=""
|
||||||
for _ in $(seq 1 60); do
|
for _ in $(seq 1 150); do
|
||||||
rejected="$(qs_for_harness ipc call settings-system-test status | jq -r .lastError)"
|
rejected="$(qs_for_harness ipc call settings-system-test status | jq -r .lastError)"
|
||||||
[[ -n "$rejected" ]] && break
|
[[ -n "$rejected" ]] && break
|
||||||
sleep 0.1
|
sleep 0.1
|
||||||
@@ -215,7 +221,7 @@ qs_for_harness ipc call settings-system-test apply \
|
|||||||
"$original_vrr" "$original_direct" >/dev/null
|
"$original_vrr" "$original_direct" >/dev/null
|
||||||
|
|
||||||
restored=false
|
restored=false
|
||||||
for _ in $(seq 1 40); do
|
for _ in $(seq 1 150); do
|
||||||
if [[ "$(read_option render:cm_auto_hdr)" == "$original_auto_hdr" \
|
if [[ "$(read_option render:cm_auto_hdr)" == "$original_auto_hdr" \
|
||||||
&& "$(read_option misc:vrr)" == "$original_vrr" \
|
&& "$(read_option misc:vrr)" == "$original_vrr" \
|
||||||
&& "$(read_option render:direct_scanout)" == "$original_direct" ]]; then
|
&& "$(read_option render:direct_scanout)" == "$original_direct" ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user