[nginx-tests] Tests: adjusted delays in body discard tests.

Maxim Dounin mdounin at mdounin.ru
Thu Aug 21 01:33:01 UTC 2025


details:   http://freenginx.org/hg/nginx-tests/rev/250fb78dd270
branches:  
changeset: 2020:250fb78dd270
user:      Maxim Dounin <mdounin at mdounin.ru>
date:      Tue Aug 19 03:25:52 2025 +0300
description:
Tests: adjusted delays in body discard tests.

At least h3_request_body_discard.t occasionally fails on slow hosts due
to too short delays, and using longer delays fixes this.

diffstat:

 body_discard.t            |   6 +++---
 h2_request_body_discard.t |   6 +++---
 h3_request_body_discard.t |  14 +++++++-------
 3 files changed, 13 insertions(+), 13 deletions(-)

diffs (91 lines):

diff --git a/body_discard.t b/body_discard.t
--- a/body_discard.t
+++ b/body_discard.t
@@ -350,7 +350,7 @@ like(http(
 	'POST /unbuf HTTP/1.0' . CRLF .
 	'Content-Length: 10' . CRLF . CRLF .
 	'0',
-	sleep => 0.1,
+	sleep => 0.2,
 	body =>
 	'123456789'
 ), qr/ 502 .*backend body:::/s, 'unbuf proxy small');
@@ -366,7 +366,7 @@ like(http(
 	'Host: localhost' . CRLF .
 	'Connection: close' . CRLF .
 	'Transfer-Encoding: chunked' . CRLF . CRLF,
-	sleep => 0.1,
+	sleep => 0.2,
 	body =>
 	'a' . CRLF .
 	'0123456789' . CRLF .
@@ -380,7 +380,7 @@ like(http(
 	'Transfer-Encoding: chunked' . CRLF . CRLF .
 	'1' . CRLF .
 	'X' . CRLF,
-	sleep => 0.1,
+	sleep => 0.2,
 	body =>
 	'9' . CRLF .
 	'123456789' . CRLF .
diff --git a/h2_request_body_discard.t b/h2_request_body_discard.t
--- a/h2_request_body_discard.t
+++ b/h2_request_body_discard.t
@@ -258,11 +258,11 @@ like(http2_get_body_incomplete_nolen('/u
 
 # error_page 400 after proxy with request buffering disabled
 
-like(http2_get_body_custom('/unbuf2', 1, '', sleep => 0.1),
+like(http2_get_body_custom('/unbuf2', 1, '', sleep => 0.2),
 	qr/status: 400.*backend body:::/s, 'unbuf too short');
-like(http2_get_body_custom('/unbuf2', 1, '01', sleep => 0.1),
+like(http2_get_body_custom('/unbuf2', 1, '01', sleep => 0.2),
 	qr/status: 400.*backend body:::/s, 'unbuf too long');
-like(http2_get_body_custom('/unbuf2', 1, '01', sleep => 0.1, more => 1),
+like(http2_get_body_custom('/unbuf2', 1, '01', sleep => 0.2, more => 1),
 	qr/status: 400.*backend body:::/s, 'unbuf too long more');
 
 # error_page 413 and $content_length
diff --git a/h3_request_body_discard.t b/h3_request_body_discard.t
--- a/h3_request_body_discard.t
+++ b/h3_request_body_discard.t
@@ -258,7 +258,7 @@ like(http3_get_body_custom('/proxy', 1, 
 
 like(http3_get('/unbuf'),
 	qr/status: 502.*backend body:::/s, 'unbuf proxy');
-like(http3_get_body_custom('/unbuf', 10, '0123456789', sleep => 0.1),
+like(http3_get_body_custom('/unbuf', 10, '0123456789', sleep => 0.2),
 	qr/status: 502.*backend body:::/s, 'unbuf proxy small');
 like(http3_get_body_incomplete('/unbuf', 10000, '0123456789'),
 	qr/status: 502.*backend body:::/s, 'unbuf proxy long');
@@ -271,11 +271,11 @@ like(http3_get_body_incomplete_nolen('/u
 
 # error_page 400 after proxy with request buffering disabled
 
-like(http3_get_body_custom('/unbuf2', 1, '', sleep => 0.1),
+like(http3_get_body_custom('/unbuf2', 1, '', sleep => 0.2),
 	qr/status: 400.*backend body:::/s, 'unbuf too short');
-like(http3_get_body_custom('/unbuf2', 1, '01', sleep => 0.1),
+like(http3_get_body_custom('/unbuf2', 1, '01', sleep => 0.2),
 	qr/status: 400.*backend body:::/s, 'unbuf too long');
-like(http3_get_body_custom('/unbuf2', 1, '01', sleep => 0.1, more => 1),
+like(http3_get_body_custom('/unbuf2', 1, '01', sleep => 0.2, more => 1),
 	qr/status: 400.*backend body:::/s, 'unbuf too long more');
 
 # error_page 413 and $content_length
@@ -333,12 +333,12 @@ sub http3_get_body_nolen {
 	my $sid = $s->new_stream({ path => $uri, body_more => 1 });
 
 	if (defined $body2) {
-		select undef, undef, undef, 0.1;
+		select undef, undef, undef, 0.2;
 		$s->h3_body($body, $sid, { body_more => 1 });
-		select undef, undef, undef, 0.1;
+		select undef, undef, undef, 0.2;
 		$s->h3_body($body2, $sid);
 	} else {
-		select undef, undef, undef, 0.1;
+		select undef, undef, undef, 0.2;
 		$s->h3_body($body, $sid);
 	}
 


More information about the nginx-devel mailing list