- is(system(@xcpdb, "-R$R", $ibx->{mainrepo}), 0, "xcpdb -R$R");
- my @new_parts = grep(m!/\d+\z!, glob("$ibx->{mainrepo}/xap*/*"));
- is(scalar(@new_parts), $R, 'repartitioned to two parts');
+ my $cmd = [@xcpdb, "-R$R", $ibx->{inboxdir}];
+ push @$cmd, '--compact' if $R == 1;
+ ok(run_script($cmd), "xcpdb -R$R");
+ my @new_shards = grep(m!/\d+\z!, glob("$ibx->{inboxdir}/xap*/*"));
+ is(scalar(@new_shards), $R, 'resharded to two shards');