From 5b7e9316a5a9deac64330e8cb6d10785dc7dfc7c Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 24 Nov 2015 21:28:50 +0000 Subject: t0105: fix test reliability 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 } -- cgit v1.2.3-24-ge0c7