From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 0DD9D1F5C6 for ; Fri, 15 Nov 2019 09:51:06 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 28/29] t/xcpdb-reshard: use run_script for -xcpdb Date: Fri, 15 Nov 2019 09:50:59 +0000 Message-Id: <20191115095100.25633-29-e@80x24.org> In-Reply-To: <20191115095100.25633-1-e@80x24.org> References: <20191115095100.25633-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: This more than doubles the speed of the test, since we make many invocations of -xcpdb. --- t/xcpdb-reshard.t | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/t/xcpdb-reshard.t b/t/xcpdb-reshard.t index 43e08639..88e6c3dc 100644 --- a/t/xcpdb-reshard.t +++ b/t/xcpdb-reshard.t @@ -33,8 +33,7 @@ my $ibx = PublicInbox::Inbox->new({ -primary_address => 'test@example.com', indexlevel => 'medium', }); -my $path = 'blib/script'; -my @xcpdb = ("$path/public-inbox-xcpdb", '-q'); +my @xcpdb = qw(-xcpdb -q); my $nproc = 8; my $ndoc = 13; my $im = PublicInbox::InboxWritable->new($ibx, {nproc => $nproc})->importer(1); @@ -51,7 +50,7 @@ my %nums = map {; "$_->{num}" => 1 } @$orig; # ensure we can go up or down in shards, or stay the same: for my $R (qw(2 4 1 3 3)) { delete $ibx->{search}; # release old handles - is(system(@xcpdb, "-R$R", $ibx->{inboxdir}), 0, "xcpdb -R$R"); + ok(run_script([@xcpdb, "-R$R", $ibx->{inboxdir}]), "xcpdb -R$R"); my @new_shards = grep(m!/\d+\z!, glob("$ibx->{inboxdir}/xap*/*")); is(scalar(@new_shards), $R, 'resharded to two shards'); my $msgs = $ibx->search->query('s:this');