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,AWL,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 3AFFB1F462 for ; Sat, 15 Jun 2019 17:38:04 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] t/git-http-backend: explain purpose of test Date: Sat, 15 Jun 2019 17:38:04 +0000 Message-Id: <20190615173804.8012-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: I found myself tempted to switch to HTTP::Tiny, here, since it's distributed with Perl since 5.14, unlike Net::HTTP (which AFAIK was never a part of Perl proper). But we really want to use Net::HTTP, here, since it's lower-level and allows us to trigger server-side buffering by not reading the entity body. --- t/git-http-backend.t | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/t/git-http-backend.t b/t/git-http-backend.t index 5ac0a4a..fc2d546 100644 --- a/t/git-http-backend.t +++ b/t/git-http-backend.t @@ -1,5 +1,8 @@ # Copyright (C) 2016-2018 all contributors # License: AGPL-3.0+ +# +# Ensure buffering behavior in -httpd doesn't cause runaway memory use +# or data corruption use strict; use warnings; use Test::More; @@ -77,6 +80,8 @@ SKIP: { my ($code, $mess, %h) = $http->read_response_headers; is(200, $code, 'got 200 success for pack'); is($max, $h{'Content-Length'}, 'got expected Content-Length for pack'); + + # no $http->read_entity_body, here, since we want to force buffering foreach my $i (1..3) { sleep 1; my $diff = $get_maxrss->() - $mem_a; -- EW