From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-3.2 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00 shortcircuit=no autolearn=unavailable version=3.3.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 6B64520D59 for ; Sat, 14 May 2016 01:26:34 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] t/nntpd: avoid fork+exec for search indexing Date: Sat, 14 May 2016 01:26:34 +0000 Message-Id: <20160514012634.2990-1-e@80x24.org> List-Id: The Xapian search index is required for the NNTP server, so there's no point in calling system() for it like we do in other tests. This should speed up the test a small amount. --- t/nntpd.t | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/t/nntpd.t b/t/nntpd.t index a389a3e..a9df36d 100644 --- a/t/nntpd.t +++ b/t/nntpd.t @@ -27,7 +27,6 @@ my $addr = $group . '@example.com'; my $cfgpfx = "publicinbox.$group"; my $nntpd = 'blib/script/public-inbox-nntpd'; my $init = 'blib/script/public-inbox-init'; -my $index = 'blib/script/public-inbox-index'; use_ok 'PublicInbox::Import'; use_ok 'PublicInbox::Git'; @@ -65,7 +64,8 @@ EOF my $im = PublicInbox::Import->new($git, 'test', $addr); $im->add($mime); $im->done; - is(0, system($index, $maindir), 'indexed git dir'); + my $s = PublicInbox::SearchIdx->new($maindir, 1); + $s->index_sync; } ok($sock, 'sock created');