Mercurial > hg > nginx-tests
diff h2_proxy_request_buffering_ssl.t @ 945:d73bef563aea
Tests: speed up HTTP/2 tests.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Wed, 15 Jun 2016 13:27:56 +0300 |
parents | 29aa547dd963 |
children | 4dc302d8e04f |
line wrap: on
line diff
--- a/h2_proxy_request_buffering_ssl.t +++ b/h2_proxy_request_buffering_ssl.t @@ -133,8 +133,8 @@ is($f->{http_end}(), 200, 'many - respon $f = get_body('/', 'content-length' => 0); ok($f->{headers}, 'empty'); -is($f->{upload}('', body_more => 1), '', 'empty - part'); -is($f->{upload}(''), '', 'empty - part 2'); +is($f->{upload}('', body_more => 1, wait => 0.2), '', 'empty - part'); +is($f->{upload}('', wait => 0.2), '', 'empty - part 2'); is($f->{http_end}(), 200, 'empty - response'); $f = get_body('/', 'content-length' => 10); @@ -174,7 +174,7 @@ is($f->{http_end}(), 200, 'chunked many $f = get_body('/chunked'); ok($f->{headers}, 'chunked empty'); -is($f->{upload}('', body_more => 1), '', 'chunked empty - part'); +is($f->{upload}('', body_more => 1, wait => 0.2), '', 'chunked empty - part'); is($f->{upload}(''), '0' . CRLF . CRLF, 'chunked empty - part 2'); is($f->{http_end}(), 200, 'chunked empty - response'); @@ -222,11 +222,11 @@ sub get_body { my $chunked = $f->{headers} =~ /chunked/; my $body_read = sub { - my ($s, $buf, $len) = @_; + my ($s, $buf, $len, $wait) = @_; for (1 .. 10) { - $buf = raw_read($s, $buf, length($buf) + 1, \&log2i) - or return ''; + $buf = raw_read($s, $buf, length($buf) + 1, \&log2i, + $wait) or return ''; my $got = 0; $got += $chunked ? hex $_ : $_ for $chunked @@ -243,7 +243,7 @@ sub get_body { h2_body($sess, $body, { %extra }); - return $body_read->($client, '', length($body)); + return $body_read->($client, '', length($body), $extra{wait}); }; $f->{http_end} = sub { $client->write(<<EOF);