ci(smoke): fix the mpd / hardware / leak tiers so they actually run
The first run went green but the best-effort tiers silently didn't exercise
anything:
- state.sh: the mpd `audio_output { ... }` block was on one line, which mpd
rejects ("Unknown tokens after '{'"), so mpd never started and the mpd
sub-tier (the #5183 empty-queue repro) skipped. Split the block across lines.
Also move teardown into a cleanup() with `|| true` so a dead-pid kill under
`set -e` no longer makes the step exit 1.
- hardware.sh: umockdev-run's LD_PRELOAD lands ahead of the linked-in ASan
runtime, so ASan aborted before main() ("ASan runtime does not come first")
and waybar never started -- the backlight/slider (#5179) path wasn't tested.
Set verify_asan_link_order=0 so the instrumented binary runs under the preload.
- leakcheck.sh: abort_on_error=1 turned LSan's exit report into a core dump;
force abort_on_error=0 for this report-only tier.
- lib.sh: assert_clean now also flags "ASan runtime does not come first" so a
future preload/link-order regression fails loudly instead of passing.
This commit is contained in:
@@ -19,6 +19,11 @@ if ! command -v umockdev-run >/dev/null; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
smoke::setup
|
smoke::setup
|
||||||
|
# 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
|
||||||
|
# runtime does not come first"). Disabling the link-order check lets the
|
||||||
|
# instrumented binary run under the preload.
|
||||||
|
export ASAN_OPTIONS="${ASAN_OPTIONS}:verify_asan_link_order=0"
|
||||||
smoke::start_compositor
|
smoke::start_compositor
|
||||||
trap smoke::stop EXIT
|
trap smoke::stop EXIT
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,9 @@ source "$DIR/lib.sh"
|
|||||||
|
|
||||||
export SMOKE_DETECT_LEAKS=1
|
export SMOKE_DETECT_LEAKS=1
|
||||||
smoke::setup
|
smoke::setup
|
||||||
|
# Report leaks without aborting: abort_on_error=1 (the default gate) would turn
|
||||||
|
# LSan's exit-time report into a core dump. This tier only reports.
|
||||||
|
export ASAN_OPTIONS="detect_leaks=1:halt_on_error=0:abort_on_error=0:detect_odr_violation=0"
|
||||||
smoke::start_compositor
|
smoke::start_compositor
|
||||||
trap smoke::stop EXIT
|
trap smoke::stop EXIT
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -111,7 +111,7 @@ smoke::assert_alive() {
|
|||||||
# Fail on sanitizer reports and GTK/GLib criticals in the log.
|
# Fail on sanitizer reports and GTK/GLib criticals in the log.
|
||||||
smoke::assert_clean() {
|
smoke::assert_clean() {
|
||||||
local bad
|
local bad
|
||||||
bad="$(grep -iE 'AddressSanitizer|runtime error:|LeakSanitizer|Gtk-CRITICAL|GLib-CRITICAL|GLib-GObject-CRITICAL|assertion .*failed|segfault|terminate called|SUMMARY: .*Sanitizer' "$SMOKE_LOG" || true)"
|
bad="$(grep -iE 'AddressSanitizer|runtime error:|LeakSanitizer|Gtk-CRITICAL|GLib-CRITICAL|GLib-GObject-CRITICAL|assertion .*failed|segfault|terminate called|SUMMARY: .*Sanitizer|ASan runtime does not come first' "$SMOKE_LOG" || true)"
|
||||||
if [ -n "$bad" ]; then
|
if [ -n "$bad" ]; then
|
||||||
echo "::error::waybar reported sanitizer/critical issues:"
|
echo "::error::waybar reported sanitizer/critical issues:"
|
||||||
echo "$bad"
|
echo "$bad"
|
||||||
|
|||||||
+15
-5
@@ -15,14 +15,21 @@ DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|||||||
# shellcheck source=lib.sh
|
# shellcheck source=lib.sh
|
||||||
source "$DIR/lib.sh"
|
source "$DIR/lib.sh"
|
||||||
|
|
||||||
smoke::setup
|
|
||||||
smoke::start_compositor
|
|
||||||
trap 'smoke::stop; [ -n "${MPD_PID:-}" ] && kill "$MPD_PID" 2>/dev/null; [ -n "${PA_STARTED:-}" ] && pulseaudio --kill 2>/dev/null; true' EXIT
|
|
||||||
|
|
||||||
fail=0
|
fail=0
|
||||||
MPD_PID=""
|
MPD_PID=""
|
||||||
PA_STARTED=""
|
PA_STARTED=""
|
||||||
|
|
||||||
|
cleanup() {
|
||||||
|
smoke::stop
|
||||||
|
[ -n "$MPD_PID" ] && kill "$MPD_PID" 2>/dev/null || true
|
||||||
|
[ -n "$PA_STARTED" ] && pulseaudio --kill 2>/dev/null || true
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
|
smoke::setup
|
||||||
|
smoke::start_compositor
|
||||||
|
trap cleanup EXIT
|
||||||
|
|
||||||
# ---------------------------------------------------------------- mpd -----
|
# ---------------------------------------------------------------- mpd -----
|
||||||
mpd_tier() {
|
mpd_tier() {
|
||||||
if ! command -v mpd >/dev/null || ! command -v mpc >/dev/null; then
|
if ! command -v mpd >/dev/null || ! command -v mpc >/dev/null; then
|
||||||
@@ -39,7 +46,10 @@ state_file "$d/state"
|
|||||||
pid_file "$d/pid"
|
pid_file "$d/pid"
|
||||||
bind_to_address "127.0.0.1"
|
bind_to_address "127.0.0.1"
|
||||||
port "6600"
|
port "6600"
|
||||||
audio_output { type "null" name "null" }
|
audio_output {
|
||||||
|
type "null"
|
||||||
|
name "null"
|
||||||
|
}
|
||||||
EOF
|
EOF
|
||||||
mpd --no-daemon "$conf" >/tmp/mpd.log 2>&1 &
|
mpd --no-daemon "$conf" >/tmp/mpd.log 2>&1 &
|
||||||
MPD_PID=$!
|
MPD_PID=$!
|
||||||
|
|||||||
Reference in New Issue
Block a user