[PATCH] Tests: adjusted delays in body discard tests
Maxim Dounin
mdounin at mdounin.ru
Tue Aug 19 00:26:18 UTC 2025
# HG changeset patch
# User Maxim Dounin <mdounin at mdounin.ru>
# Date 1755563152 -10800
# Tue Aug 19 03:25:52 2025 +0300
# Node ID 250fb78dd27079ed3cb3fd5d3b7a0132ad2ce89f
# Parent b579440daf23d27ff4a72d33e01370d0eac101cf
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.
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