From a851c5118bdd8559986fbc5a1905469071f64c40 Mon Sep 17 00:00:00 2001 From: Luca Boccassi Date: Fri, 20 Feb 2026 19:28:34 +0000 Subject: [PATCH] test: avoid hanging forever waiting for udev if not a booted system test_sd_device_enumerator_filter_subsystem hangs forever in OBS builds, as it waits for the udev queue to be drained. But this is not a booted system, with systemd and udev, so nothing will do that. Skip the test in that case. --- src/libsystemd/sd-device/test-sd-device.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/libsystemd/sd-device/test-sd-device.c b/src/libsystemd/sd-device/test-sd-device.c index 40a40a70bf..db7c9420cc 100644 --- a/src/libsystemd/sd-device/test-sd-device.c +++ b/src/libsystemd/sd-device/test-sd-device.c @@ -3,6 +3,7 @@ #include #include +#include "sd-daemon.h" #include "sd-event.h" #include "capability-util.h" @@ -466,6 +467,10 @@ TEST(sd_device_enumerator_filter_subsystem) { return; } + /* The rest of this test depends on a full booted system with a working udev and so on */ + if (!sd_booted()) + return (void) log_tests_skipped("Test requires fully booted system with udev/etc, skipping to avoid hanging forever."); + _cleanup_(sd_event_unrefp) sd_event *event = NULL; ASSERT_OK(sd_event_default(&event)); ASSERT_OK(sd_event_add_inotify(event, NULL, "/run/udev" , IN_DELETE, on_inotify, NULL));