From 35c59ac249bb5f9cba7a6c5fb6554475bfa266ca Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Tue, 4 Mar 2025 22:31:39 +0100 Subject: [PATCH] test-async: Wait for asynchronous_sync() to finish Otherwise, if the system is busy, TEST-02-UNITTESTS will fail as systemd will time out trying to kill the transient unit that we're running test-async in. --- src/test/test-async.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/test-async.c b/src/test/test-async.c index 443505c3eb0..2b87faba7db 100644 --- a/src/test/test-async.c +++ b/src/test/test-async.c @@ -15,7 +15,9 @@ #include "tmpfile-util.h" TEST(asynchronous_sync) { - ASSERT_OK(asynchronous_sync(NULL)); + _cleanup_(pidref_done) PidRef pidref = PIDREF_NULL; + ASSERT_OK(asynchronous_sync(&pidref)); + ASSERT_OK(pidref_wait_for_terminate(&pidref, /* ret= */ NULL)); } static void wait_fd_closed(int fd) { -- 2.47.3