]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/httpd-unix.t
t/httpd-unix.t: avoid race in between bind() and listen()
[public-inbox.git] / t / httpd-unix.t
index 758277c9d67977304663346fed62b3e1d5e984de..04f4b8fa9807e239f2224b3f31308bdc7e563127 100644 (file)
@@ -42,8 +42,9 @@ my $spawn_httpd = sub {
 
 ok(!-S $unix, 'UNIX socket does not exist, yet');
 $spawn_httpd->("-l$unix");
+my %o = (Peer => $unix, Type => SOCK_STREAM);
 for (1..1000) {
-       last if -S $unix;
+       last if -S $unix && IO::Socket::UNIX->new(%o);
        select undef, undef, undef, 0.02
 }