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 020CB1F463 for ; Fri, 13 Sep 2019 01:50:44 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [RFC] t/git-http-backend: add MANY_CLONE test Date: Fri, 13 Sep 2019 01:50:43 +0000 Message-Id: <20190913015043.17149-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Not a final test and I don't think I'll put this into master, but it could help find some bugs in GitHTTPBackend, HTTPD/Async or Qspawn code affecting lore. Using GIANT_GIT_DIR=/path/to/git.git and MANY_CLONE=1, I'm unable to find lingering FDs in lsof(8) output which is dumped via diag. --- t/git-http-backend.psgi | 5 +++++ t/git-http-backend.t | 15 ++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/t/git-http-backend.psgi b/t/git-http-backend.psgi index ed70d501..0ac690ba 100644 --- a/t/git-http-backend.psgi +++ b/t/git-http-backend.psgi @@ -9,6 +9,11 @@ use Plack::Builder; use BSD::Resource qw(getrusage); my $git_dir = $ENV{GIANT_GIT_DIR} or die 'GIANT_GIT_DIR not defined in env'; my $git = PublicInbox::Git->new($git_dir); + +# I don't have enough memory to use the default 32 process limiter: +my $small_limiter = PublicInbox::Qspawn::Limiter->new(2); +$git->{-httpbackend_limiter} = $small_limiter; + builder { enable 'Head'; sub { diff --git a/t/git-http-backend.t b/t/git-http-backend.t index 1d9bb9f3..d9b33bad 100644 --- a/t/git-http-backend.t +++ b/t/git-http-backend.t @@ -82,7 +82,7 @@ SKIP: { } } -{ +unless ($ENV{MANY_CLONE}) { my $c = fork; if ($c == 0) { setsid(); @@ -112,6 +112,19 @@ SKIP: { ok($diff < 2048, 'no bloating caused by slow smart client'); } +if ($ENV{MANY_CLONE}) { + system(<