From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.9 required=3.0 tests=ALL_TRUSTED,BAYES_00, URIBL_BLOCKED shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: rainbows-public@bogomips.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id E7878633807; Tue, 24 Nov 2015 21:36:32 +0000 (UTC) From: Eric Wong To: rainbows-public@bogomips.org Cc: Eric Wong Subject: [PATCH] t0105: fix test reliability Date: Tue, 24 Nov 2015 21:36:31 +0000 Message-Id: <20151124213631.3425-1-e@80x24.org> List-Id: It's possible curl will be sending to us and detect an error in the send before it has a chance to read our (premature) 413 response. Of course, we cannot afford to read an entire request when returning a premature 413 response because we risk wasting bandwidth that way. --- t/t0105-rack-input-limit-bigger.sh | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/t/t0105-rack-input-limit-bigger.sh b/t/t0105-rack-input-limit-bigger.sh index 1ae0191..ee03d44 100755 --- a/t/t0105-rack-input-limit-bigger.sh +++ b/t/t0105-rack-input-limit-bigger.sh @@ -25,7 +25,11 @@ t_begin "stops a regular request" && { rm -f $tmp dbgcat curl_err dbgcat curl_out - grep 413 $curl_err + if ! grep 413 $curl_err + then + # send error as documented in curl(1) manpage + grep -F '(55)' $curl_err + fi test -e $ok } @@ -36,7 +40,11 @@ t_begin "stops a large chunked request" && { http://$listen/ > $curl_out 2> $curl_err || > $ok dbgcat curl_err dbgcat curl_out - grep 413 $curl_err + if ! grep 413 $curl_err + then + # send error as documented in curl(1) manpage + grep -F '(55)' $curl_err + fi test -e $ok } -- EW