X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=t%2Fgit-http-backend.t;h=c2a0465335c5b7cf94ffa782553995703b7dd50d;hb=826a69a8c5c46278c10f1f9670edc4b953f3f88f;hp=fc2d5462db345ee9638f59833b38b7737c5dd4c8;hpb=2cc052a06358ee293574d2d8aaa8c38c1a1026d7;p=public-inbox.git diff --git a/t/git-http-backend.t b/t/git-http-backend.t index fc2d5462..c2a04653 100644 --- a/t/git-http-backend.t +++ b/t/git-http-backend.t @@ -1,4 +1,4 @@ -# Copyright (C) 2016-2018 all contributors +# Copyright (C) 2016-2019 all contributors # License: AGPL-3.0+ # # Ensure buffering behavior in -httpd doesn't cause runaway memory use @@ -7,7 +7,6 @@ use strict; use warnings; use Test::More; use File::Temp qw/tempdir/; -use IO::Socket::INET; use POSIX qw(setsid); my $git_dir = $ENV{GIANT_GIT_DIR}; @@ -24,14 +23,7 @@ my $tmpdir = tempdir('pi-git-http-backend-XXXXXX', TMPDIR => 1, CLEANUP => 1); my $err = "$tmpdir/stderr.log"; my $out = "$tmpdir/stdout.log"; my $httpd = 'blib/script/public-inbox-httpd'; -my %opts = ( - LocalAddr => '127.0.0.1', - ReuseAddr => 1, - Proto => 'tcp', - Type => SOCK_STREAM, - Listen => 1024, -); -my $sock = IO::Socket::INET->new(%opts); +my $sock = tcp_server(); my $host = $sock->sockhost; my $port = $sock->sockport; my $pid; @@ -52,7 +44,7 @@ my $get_maxrss = sub { { ok($sock, 'sock created'); - my $cmd = [ $httpd, "--stdout=$out", "--stderr=$err", $psgi ]; + my $cmd = [ $httpd, '-W0', "--stdout=$out", "--stderr=$err", $psgi ]; ok(defined($pid = spawn_listener(undef, $cmd, [$sock])), 'forked httpd process successfully'); }