about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-06-30 22:32:32 +0000
committerEric Wong <e@80x24.org>2019-06-30 22:32:57 +0000
commit15f98820ca5434f40410a6fceed1e37e50ab68a7 (patch)
tree251d359041bfcd6cc423957d91d0fbd561401922
parent8472ccddd410a136b5aaa8bb886c7cf0dc302411 (diff)
downloadpublic-inbox-15f98820ca5434f40410a6fceed1e37e50ab68a7.tar.gz
We need to be able to successfully connect() to the socket
before attempting further tests.  Merely testing for the
existence of a socket isn't enough, since the server may've
only done bind(), not listen().
-rw-r--r--t/httpd-unix.t3
1 files changed, 2 insertions, 1 deletions
diff --git a/t/httpd-unix.t b/t/httpd-unix.t
index 758277c9..04f4b8fa 100644
--- a/t/httpd-unix.t
+++ b/t/httpd-unix.t
@@ -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
 }