user/dev discussion of public-inbox itself
 help / color / Atom feed
* [PATCH] t/git-http-backend: explain purpose of test
@ 2019-06-15 17:38 Eric Wong
  0 siblings, 0 replies; only message in thread
From: Eric Wong @ 2019-06-15 17:38 UTC (permalink / raw)
  To: meta

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, back to index

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-15 17:38 [PATCH] t/git-http-backend: explain purpose of test Eric Wong

user/dev discussion of public-inbox itself

Archives are clonable:
	git clone --mirror https://public-inbox.org/meta
	git clone --mirror http://czquwvybam4bgbro.onion/meta
	git clone --mirror http://hjrcffqmbrq6wope.onion/meta
	git clone --mirror http://ou63pmih66umazou.onion/meta

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.mail.public-inbox.meta
	nntp://ou63pmih66umazou.onion/inbox.comp.mail.public-inbox.meta
	nntp://czquwvybam4bgbro.onion/inbox.comp.mail.public-inbox.meta
	nntp://hjrcffqmbrq6wope.onion/inbox.comp.mail.public-inbox.meta
	nntp://news.gmane.org/gmane.mail.public-inbox.general

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/ public-inbox