From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 894C31F9F3 for ; Tue, 19 Oct 2021 09:33:46 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 01/11] test_common: lazy-require AutoReap Date: Tue, 19 Oct 2021 09:33:36 +0000 Message-Id: <20211019093346.30885-2-e@80x24.org> In-Reply-To: <20211019093346.30885-1-e@80x24.org> References: <20211019093346.30885-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: This might speed up non-daemon-using tests. --- lib/PublicInbox/TestCommon.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/PublicInbox/TestCommon.pm b/lib/PublicInbox/TestCommon.pm index 835779996d56..fb0d5a4e6ede 100644 --- a/lib/PublicInbox/TestCommon.pm +++ b/lib/PublicInbox/TestCommon.pm @@ -6,7 +6,6 @@ package PublicInbox::TestCommon; use strict; use parent qw(Exporter); use v5.10.1; -use PublicInbox::AutoReap; use Fcntl qw(FD_CLOEXEC F_SETFD F_GETFD :seek); use POSIX qw(dup2); use IO::Socket::INET; @@ -430,6 +429,7 @@ sub tail_f (@) { require PublicInbox::Spawn; my $pid = PublicInbox::Spawn::spawn($cmd, undef, { 1 => 2 }); wait_for_tail($pid, scalar @_); + require PublicInbox::AutoReap; PublicInbox::AutoReap->new($pid, \&wait_for_tail); } @@ -493,6 +493,7 @@ sub start_script { die "FAIL: ",join(' ', $key, @argv), ": $!\n"; } } + require PublicInbox::AutoReap; my $td = PublicInbox::AutoReap->new($pid); $td->{-extra} = $tail; $td;