about summary refs log tree commit homepage
path: root/t/v2mirror.t
diff options
context:
space:
mode:
Diffstat (limited to 't/v2mirror.t')
-rw-r--r--t/v2mirror.t11
1 files changed, 6 insertions, 5 deletions
diff --git a/t/v2mirror.t b/t/v2mirror.t
index 37d64e83..b8824182 100644
--- a/t/v2mirror.t
+++ b/t/v2mirror.t
@@ -1,4 +1,4 @@
-# Copyright (C) 2018-2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 use strict;
 use v5.10.1;
@@ -14,7 +14,7 @@ use IO::Uncompress::Gunzip qw(gunzip $GunzipError);
 
 # Integration tests for HTTP cloning + mirroring
 require_mods(qw(Plack::Util Plack::Builder
-                HTTP::Date HTTP::Status Search::Xapian DBD::SQLite));
+                HTTP::Date HTTP::Status Xapian DBD::SQLite));
 use_ok 'PublicInbox::V2Writable';
 use PublicInbox::InboxWritable;
 use PublicInbox::Eml;
@@ -330,12 +330,12 @@ SKIP: {
         require_mods('Email::MIME', 1); # for legacy revision
         # using plackup to test old PublicInbox::WWW since -httpd from
         # back then relied on some packages we no longer depend on
-        my $plackup = which('plackup') or skip('no plackup in path', 1);
+        my $plackup = require_cmd('plackup', 1) or skip('no plackup in path', 1);
         require PublicInbox::Lock;
         chomp $oldrev;
         my ($base) = ($0 =~ m!\b([^/]+)\.[^\.]+\z!);
         my $wt = "t/data-gen/$base.pre-manifest-$oldrev";
-        my $lk = bless { lock_path => __FILE__ }, 'PublicInbox::Lock';
+        my $lk = PublicInbox::Lock->new(__FILE__);
         $lk->lock_acquire;
         my $psgi = "$wt/app.psgi";
         if (!-f $psgi) { # checkout a pre-manifest.js.gz version
@@ -368,10 +368,11 @@ EOM
         # wait for plackup socket()+bind()+listen()
         my %opt = ( Proto => 'tcp', Type => Socket::SOCK_STREAM(),
                 PeerAddr => "$host:$port" );
-        for (0..50) {
+        for (0..100) {
                 tick();
                 last if IO::Socket::INET->new(%opt);
         }
+        IO::Socket::INET->new(%opt) or xbail "connect $host:$port: $!";
         my $dst = "$tmpdir/scrape";
         @cmd = (qw(-clone -q), "http://$host:$port/v2", $dst);
         run_script(\@cmd, undef, { 2 => \($err = '') });