# HG changeset patch # User Sergey Kandaurov # Date 1614618220 -10800 # Node ID 22e0133d68b4430f9a02b1b1e60607b24d494d55 # Parent 759efa4abc7627abb0a3dd0c939f331d6a539922 Tests: added HTTP/2 test with "keepalive_timeout 0" (ticket #2142). diff --git a/h2_max_requests.t b/h2_max_requests.t --- a/h2_max_requests.t +++ b/h2_max_requests.t @@ -47,16 +47,26 @@ http { location / { } } + + server { + listen 127.0.0.1:8081 http2; + server_name localhost; + + keepalive_timeout 0; + + location / { } + } } EOF $t->write_file('index.html', 'SEE-THAT' x 50000); +$t->write_file('t.html', 'SEE-THAT'); # suppress deprecation warning open OLDERR, ">&", \*STDERR; close STDERR; -$t->run()->plan(10); +$t->run()->plan(12); open STDERR, ">&", \*OLDERR; ############################################################################### @@ -109,6 +119,28 @@ is($sum, 400000, 'max requests limited - ok($frame, 'max requests limited - GOAWAY'); is($frame->{last_sid}, $sid, 'max requests limited - GOAWAY last stream'); +# keepalive_timeout 0 + +SKIP: { +skip 'not yet', 2 unless $t->has_version('1.19.7'); + +$s = Test::Nginx::HTTP2->new(port(8081)); +$sid = $s->new_stream({ path => '/t.html' }); +$frames = $s->read(all => [{ sid => $sid, fin => 1 }, { type => 'GOAWAY' }]); + +TODO: { +local $TODO = 'not yet' unless $t->has_version('1.19.8'); + +($frame) = grep { $_->{type} eq "HEADERS" } @$frames; +is($frame->{headers}->{':status'}, 200, 'keepalive_timeout 0'); + +} + +($frame) = grep { $_->{type} eq "GOAWAY" } @$frames; +ok($frame, 'keepalive_timeout 0 - GOAWAY'); + +} + # graceful shutdown in idle state $s = Test::Nginx::HTTP2->new();