From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS6315 166.70.0.0/16 X-Spam-Status: No, score=-3.7 required=3.0 tests=AWL,BAYES_00, RCVD_IN_DNSWL_LOW,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.1 Received: from out02.mta.xmission.com (out02.mta.xmission.com [166.70.13.232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 2DF4F208F0; Wed, 1 Aug 2018 16:45:59 +0000 (UTC) Received: from in01.mta.xmission.com ([166.70.13.51]) by out02.mta.xmission.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.87) (envelope-from ) id 1fkuG6-0007wU-JJ; Wed, 01 Aug 2018 10:45:58 -0600 Received: from [97.119.167.31] (helo=x220.int.ebiederm.org) by in01.mta.xmission.com with esmtpsa (TLS1.2:ECDHE_RSA_AES_128_CBC_SHA256:128) (Exim 4.87) (envelope-from ) id 1fkuG5-0001mm-7q; Wed, 01 Aug 2018 10:45:58 -0600 From: "Eric W. Biederman" To: Eric Wong Cc: meta@public-inbox.org, "Eric W. Biederman" Date: Wed, 1 Aug 2018 11:43:41 -0500 Message-Id: <20180801164344.7911-10-ebiederm@xmission.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <878t5qkpis.fsf@xmission.com> References: <878t5qkpis.fsf@xmission.com> X-XM-SPF: eid=1fkuG5-0001mm-7q;;;mid=<20180801164344.7911-10-ebiederm@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=97.119.167.31;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1+O3/x1a6iELOLktte/bijh8R8iLHski+8= X-SA-Exim-Connect-IP: 97.119.167.31 X-SA-Exim-Mail-From: ebiederm@xmission.com Subject: [PATCH 10/13] t/v[12]reindex.t: Verify the num highwater is as expected X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) List-Id: Instrument the tests to verify the highwater num highwater mark is where it is expected. Signed-off-by: "Eric W. Biederman" --- t/v1reindex.t | 10 ++++++++++ t/v2reindex.t | 7 +++++++ 2 files changed, 17 insertions(+) diff --git a/t/v1reindex.t b/t/v1reindex.t index 876c9db3441a..8be95149723c 100644 --- a/t/v1reindex.t +++ b/t/v1reindex.t @@ -63,6 +63,7 @@ my ($mark1, $mark2, $mark3, $mark4); $minmax = [ $ibx->mm->minmax ]; ok(defined $minmax->[0] && defined $minmax->[1], 'minmax defined'); is_deeply($minmax, [ 1, 10 ], 'minmax as expected'); + is($ibx->mm->num_highwater, 10, 'num_highwater as expected'); my ($min, $max) = @$minmax; $msgmap = $ibx->mm->msg_range(\$min, $max); @@ -87,6 +88,8 @@ my ($mark1, $mark2, $mark3, $mark4); is($@, '', 'no error from reindexing'); $im->done; + is($ibx->mm->num_highwater, 10, 'num_highwater as expected'); + my ($min, $max) = $ibx->mm->minmax; is_deeply($ibx->mm->msg_range(\$min, $max), $msgmap, 'msgmap unchanged'); } @@ -107,6 +110,7 @@ ok(!-d $xap, 'Xapian directories removed'); delete $ibx->{mm}; is_deeply([ $ibx->mm->minmax ], $minmax, 'minmax unchanged'); + is($ibx->mm->num_highwater, 10, 'num_highwater as expected'); my ($min, $max) = $ibx->mm->minmax; is_deeply($ibx->mm->msg_range(\$min, $max), $msgmap, 'msgmap unchanged'); @@ -129,6 +133,7 @@ ok(!-d $xap, 'Xapian directories removed again'); ok(-d $xap, 'Xapian directories recreated'); delete $ibx->{mm}; is_deeply([ $ibx->mm->minmax ], $minmax, 'minmax unchanged'); + is($ibx->mm->num_highwater, 10, 'num_highwater as expected'); my ($min, $max) = $ibx->mm->minmax; is_deeply($ibx->mm->msg_range(\$min, $max), $msgmap, 'msgmap unchanged'); @@ -151,6 +156,7 @@ ok(!-d $xap, 'Xapian directories removed again'); ok(-d $xap, 'Xapian directories recreated'); delete $ibx->{mm}; is_deeply([ $ibx->mm->minmax ], $minmax, 'minmax unchanged'); + is($ibx->mm->num_highwater, 10, 'num_highwater as expected'); my ($min, $max) = @$minmax; is_deeply($ibx->mm->msg_range(\$min, $max), $msgmap, 'msgmap unchanged'); @@ -174,6 +180,7 @@ ok(!-d $xap, 'Xapian directories removed again'); ok(-d $xap, 'Xapian directories recreated'); delete $ibx->{mm}; is_deeply([ $ibx->mm->minmax ], $minmax, 'minmax unchanged'); + is($ibx->mm->num_highwater, 10, 'num_highwater as expected'); my $mset = $ibx->search->query('hello world', {mset=>1}); isnt($mset->size, 0, 'got Xapian search results'); @@ -199,6 +206,7 @@ ok(!-d $xap, 'Xapian directories removed again'); ok(-d $xap, 'Xapian directories recreated'); delete $ibx->{mm}; is_deeply([ $ibx->mm->minmax ], $minmax, 'minmax unchanged'); + is($ibx->mm->num_highwater, 10, 'num_highwater as expected'); my $mset = $ibx->search->reopen->query('hello world', {mset=>1}); is($mset->size, 0, "no Xapian search results"); @@ -223,6 +231,8 @@ ok(!-d $xap, 'Xapian directories removed again'); my $mset = $ibx->search->reopen->query('hello world', {mset=>1}); isnt($mset->size, 0, 'search OK after basic -> medium'); + is($ibx->mm->num_highwater, 10, 'num_highwater as expected'); + my ($min, $max) = $ibx->mm->minmax; is_deeply($ibx->mm->msg_range(\$min, $max), $msgmap, 'msgmap unchanged'); } diff --git a/t/v2reindex.t b/t/v2reindex.t index 3d217aff3c72..a5454a22abf5 100644 --- a/t/v2reindex.t +++ b/t/v2reindex.t @@ -60,6 +60,7 @@ my ($mark1, $mark2, $mark3, $mark4); $minmax = [ $ibx->mm->minmax ]; ok(defined $minmax->[0] && defined $minmax->[1], 'minmax defined'); is_deeply($minmax, [ 1, 10 ], 'minmax as expected'); + is($ibx->mm->num_highwater, 10, 'num_highwater as expected'); my ($min, $max) = @$minmax; $msgmap = $ibx->mm->msg_range(\$min, $max); @@ -85,6 +86,7 @@ my ($mark1, $mark2, $mark3, $mark4); delete $ibx->{mm}; is_deeply([ $ibx->mm->minmax ], $minmax, 'minmax unchanged'); + is($ibx->mm->num_highwater, 10, 'num_highwater as expected'); my ($min, $max) = $ibx->mm->minmax; is_deeply($ibx->mm->msg_range(\$min, $max), $msgmap, 'msgmap unchanged'); @@ -104,6 +106,7 @@ ok(!-d $xap, 'Xapian directories removed'); delete $ibx->{mm}; is_deeply([ $ibx->mm->minmax ], $minmax, 'minmax unchanged'); + is($ibx->mm->num_highwater, 10, 'num_highwater as expected'); my ($min, $max) = $ibx->mm->minmax; is_deeply($ibx->mm->msg_range(\$min, $max), $msgmap, 'msgmap unchanged'); @@ -125,6 +128,7 @@ ok(!-d $xap, 'Xapian directories removed again'); ok(-d $xap, 'Xapian directories recreated'); delete $ibx->{mm}; is_deeply([ $ibx->mm->minmax ], $minmax, 'minmax unchanged'); + is($ibx->mm->num_highwater, 10, 'num_highwater as expected'); my ($min, $max) = $ibx->mm->minmax; is_deeply($ibx->mm->msg_range(\$min, $max), $msgmap, 'msgmap unchanged'); @@ -147,6 +151,7 @@ ok(!-d $xap, 'Xapian directories removed again'); ok(-d $xap, 'Xapian directories recreated'); delete $ibx->{mm}; is_deeply([ $ibx->mm->minmax ], $minmax, 'minmax unchanged'); + is($ibx->mm->num_highwater, 10, 'num_highwater as expected'); my $mset = $ibx->search->query('"hello world"', {mset=>1}); isnt($mset->size, 0, "phrase search succeeds on indexlevel=full"); for (<"$xap/*/*">) { $sizes{$ibx->{indexlevel}} += -s _ if -f $_ } @@ -172,6 +177,7 @@ ok(!-d $xap, 'Xapian directories removed again'); ok(-d $xap, 'Xapian directories recreated'); delete $ibx->{mm}; is_deeply([ $ibx->mm->minmax ], $minmax, 'minmax unchanged'); + is($ibx->mm->num_highwater, 10, 'num_highwater as expected'); if (0) { # not sure why, but Xapian seems to fallback to terms and @@ -208,6 +214,7 @@ ok(!-d $xap, 'Xapian directories removed again'); ok(-d $xap, 'Xapian directories recreated'); delete $ibx->{mm}; is_deeply([ $ibx->mm->minmax ], $minmax, 'minmax unchanged'); + is($ibx->mm->num_highwater, 10, 'num_highwater as expected'); my $mset = $ibx->search->query('hello', {mset=>1}); is($mset->size, 0, "search fails on indexlevel='basic'"); for (<"$xap/*/*">) { $sizes{$ibx->{indexlevel}} += -s _ if -f $_ } -- 2.17.1