From bd8289c824905d57316e9d9eb469267bc406b0ed Mon Sep 17 00:00:00 2001 From: EW Date: Tue, 6 Jun 2023 10:09:25 +0000 Subject: 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 4e11837..4dcc8dc 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'); } -- cgit v1.2.3-24-ge0c7