From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH] xt/create-many-inboxes: adjust for detect_nproc, no fsync
Date: Fri, 19 Mar 2021 07:22:58 +0300 [thread overview]
Message-ID: <20210319042258.23925-1-e@80x24.org> (raw)
detect_nproc is in the IPC module, now; and we can safely
disable fsync when creating test data.
And "modernize" up to 5.10.1 while we're at it.
The use fsync was causing this to run for hours instead
of minutes since I forgot to use eatmydata.
---
xt/create-many-inboxes.t | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/xt/create-many-inboxes.t b/xt/create-many-inboxes.t
index f44334cc..d22803e3 100644
--- a/xt/create-many-inboxes.t
+++ b/xt/create-many-inboxes.t
@@ -2,9 +2,10 @@
# Copyright (C) 2020-2021 all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
use strict;
-use Test::More;
+use v5.10.1;
use PublicInbox::TestCommon;
use PublicInbox::Eml;
+use PublicInbox::IPC;
use File::Path qw(mkpath);
use IO::Handle (); # autoflush
use POSIX qw(_exit);
@@ -21,7 +22,7 @@ require_git 2.6;
require_mods(qw(DBD::SQLite Search::Xapian));
use_ok 'PublicInbox::V2Writable';
my $nr_inbox = $ENV{NR_INBOX} // 10;
-my $nproc = $ENV{NPROC} || PublicInbox::V2Writable::detect_nproc() || 2;
+my $nproc = $ENV{NPROC} || PublicInbox::IPC::detect_nproc() || 2;
my $indexlevel = $ENV{TEST_INDEXLEVEL} // 'basic';
diag "NR_INBOX=$nr_inbox NPROC=$nproc TEST_INDEXLEVEL=$indexlevel";
diag "TEST_MANY_ROOT=$many_root";
@@ -39,6 +40,7 @@ my $v2_init_add = sub {
address => [ "test-$i\@example.com" ],
url => [ "//example.com/test-$i" ],
version => 2,
+ -no_fsync => 1,
});
$ibx->{indexlevel} = $indexlevel if $level_cfg ne '';
my $entry = <<EOF;
reply other threads:[~2021-03-19 4:22 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: http://public-inbox.org/README
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20210319042258.23925-1-e@80x24.org \
--to=e@80x24.org \
--cc=meta@public-inbox.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).