ci(smoke): keep the compositor alive between hardware cases

hardware.sh called smoke::stop between umockdev cases, but smoke::stop runs
`swaymsg exit` and tears down the shared compositor -- so only the first case
(backlight) had a display and the rest failed with "cannot open display".
Kill only waybar between cases; leave compositor teardown to the EXIT trap.
This commit is contained in:
Alex
2026-07-06 02:08:06 +02:00
parent eee2ab92fe
commit 624623215d
+7 -2
View File
@@ -18,6 +18,11 @@ if ! command -v umockdev-run >/dev/null; then
echo "(umockdev not installed, skipping hardware tier)"; exit 0 echo "(umockdev not installed, skipping hardware tier)"; exit 0
fi fi
# Kill only waybar between cases -- smoke::stop would `swaymsg exit` the shared
# compositor, and the next case couldn't open the display (compositor teardown is
# the EXIT trap's job).
kill_waybar() { kill "$WAYBAR_PID" 2>/dev/null || true; sleep 1; WAYBAR_PID=""; }
smoke::setup smoke::setup
# waybar is linked with ASan, but umockdev-run injects its own LD_PRELOAD, which # waybar is linked with ASan, but umockdev-run injects its own LD_PRELOAD, which
# lands ahead of the ASan runtime and makes ASan abort before main() ("ASan # lands ahead of the ASan runtime and makes ASan abort before main() ("ASan
@@ -65,7 +70,7 @@ EOF
WAYBAR_WRAP="umockdev-run --device $dev --" smoke::launch_waybar "$cfg" "$DIR/style.css" 5 WAYBAR_WRAP="umockdev-run --device $dev --" smoke::launch_waybar "$cfg" "$DIR/style.css" 5
smoke::assert_alive || fail=1 smoke::assert_alive || fail=1
smoke::assert_clean || fail=1 smoke::assert_clean || fail=1
smoke::stop; WAYBAR_PID="" kill_waybar
echo "::endgroup::" echo "::endgroup::"
} }
@@ -85,7 +90,7 @@ EOF
WAYBAR_WRAP="umockdev-run --device $BL_DEV --" smoke::launch_waybar "$cfg" "$DIR/style.css" 5 WAYBAR_WRAP="umockdev-run --device $BL_DEV --" smoke::launch_waybar "$cfg" "$DIR/style.css" 5
smoke::assert_alive || fail=1 smoke::assert_alive || fail=1
smoke::assert_clean || fail=1 smoke::assert_clean || fail=1
smoke::stop; WAYBAR_PID="" kill_waybar
echo "::endgroup::" echo "::endgroup::"
[ "$fail" = 0 ] || { echo "::error::hardware tier failed"; exit 1; } [ "$fail" = 0 ] || { echo "::error::hardware tier failed"; exit 1; }