X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FTestCommon.pm;h=55d82fc08592d0efa1370e1aeb7f4e2886075d49;hb=81ea7f0100f016ad8c66605b49230e876a1eb82d;hp=04adede054e30a9005286495a7c941c54c78fc5f;hpb=f2ee1e5f1c36afee3bf80e42e9c5f3196dded34f;p=public-inbox.git diff --git a/lib/PublicInbox/TestCommon.pm b/lib/PublicInbox/TestCommon.pm index 04adede0..55d82fc0 100644 --- a/lib/PublicInbox/TestCommon.pm +++ b/lib/PublicInbox/TestCommon.pm @@ -740,14 +740,18 @@ sub test_httpd ($$;$) { $env->{$_} or BAIL_OUT "$_ unset"; } SKIP: { - require_mods(qw(Plack::Test::ExternalServer), $skip // 1); + require_mods(qw(Plack::Test::ExternalServer LWP::UserAgent), + $skip // 1); my $sock = tcp_server() or die; my ($out, $err) = map { "$env->{TMPDIR}/std$_.log" } qw(out err); my $cmd = [ qw(-httpd -W0), "--stdout=$out", "--stderr=$err" ]; my $td = start_script($cmd, $env, { 3 => $sock }); my ($h, $p) = tcp_host_port($sock); local $ENV{PLACK_TEST_EXTERNALSERVER_URI} = "http://$h:$p"; - Plack::Test::ExternalServer::test_psgi(client => $client); + my $ua = LWP::UserAgent->new; + $ua->max_redirect(0); + Plack::Test::ExternalServer::test_psgi(client => $client, + ua => $ua); $td->join('TERM'); open my $fh, '<', $err or BAIL_OUT $!; my $e = do { local $/; <$fh> };