From: Eric Wong Date: Fri, 14 Jun 2019 10:09:13 +0000 (+0000) Subject: t/git-http-backend: explain purpose of test X-Git-Tag: v1.2.0~170 X-Git-Url: http://www.git.stargrave.org/?p=public-inbox.git;a=commitdiff_plain;h=2cc052a06358ee293574d2d8aaa8c38c1a1026d7 t/git-http-backend: explain purpose of test 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. --- diff --git a/t/git-http-backend.t b/t/git-http-backend.t index 5ac0a4a5..fc2d5462 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;