unofficial mirror of meta@public-inbox.org
 help / color / mirror / Atom feed
From: Eric Wong <e@80x24.org>
To: meta@public-inbox.org
Subject: [PATCH] t/git-http-backend: explain purpose of test
Date: Sat, 15 Jun 2019 17:38:04 +0000	[thread overview]
Message-ID: <20190615173804.8012-1-e@80x24.org> (raw)

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 <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
+#
+# 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


                 reply	other threads:[~2019-06-15 17:38 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: https://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=20190615173804.8012-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.
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).