diff options
author | Eric Wong <e@80x24.org> | 2019-11-15 09:50:59 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2019-11-16 11:05:24 +0000 |
commit | fd730c65a3242f609f4ec205ad605408850b2bec (patch) | |
tree | 827cc6b27f3094faea6fca07630a98eb1685459a /t/xcpdb-reshard.t | |
parent | 79ce2d0a2bab01323964f5692416fedcda6dc5ff (diff) | |
download | public-inbox-fd730c65a3242f609f4ec205ad605408850b2bec.tar.gz |
This more than doubles the speed of the test, since we make many invocations of -xcpdb.
Diffstat (limited to 't/xcpdb-reshard.t')
-rw-r--r-- | t/xcpdb-reshard.t | 5 |
1 files 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'); |