From a29364769d59e7bc0c67ad045af25f349ae913e8 Mon Sep 17 00:00:00 2001 From: EW Date: Tue, 6 Jun 2023 10:09:25 +0000 Subject: [PATCH 2/4] t/active-unix-socket: sleep for init(8) to reap worker Unfortunately, we need a sleep loop here since kill(2) succeeds on zombies and init(8) doesn't reap the worker soon enough on a FreeBSD VM. --- t/active-unix-socket.t | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/t/active-unix-socket.t b/t/active-unix-socket.t index 4e11837a..4dcc8dc6 100644 --- a/t/active-unix-socket.t +++ b/t/active-unix-socket.t @@ -84,6 +84,10 @@ is($pidf, $to_kill{u1}, 'pid file contents unchanged after 2nd start failure'); ok(-S $u1, 'socket stayed after SIGKILL'); is(IO::Socket::UNIX->new(Peer => $u1, Type => SOCK_STREAM), undef, 'fail to connect to u1'); + for (1..50) { # wait for init process to reap worker + kill(0, $worker_pid) or last; + select(undef, undef, undef, 0.011); + } ok(!kill(0, $worker_pid), 'worker gone after parent dies'); }