diff h2_max_requests.t @ 1693:5ac6efbe5552

Tests: removed TODO and try_run() checks for legacy versions.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 01 Jun 2021 16:40:18 +0300
parents 0c1bd4c23c95
children
line wrap: on
line diff
--- a/h2_max_requests.t
+++ b/h2_max_requests.t
@@ -3,7 +3,7 @@
 # (C) Sergey Kandaurov
 # (C) Nginx, Inc.
 
-# Tests for HTTP/2 protocol, http2_max_requests directive.
+# Tests for HTTP/2 protocol, keepalive directives.
 
 ###############################################################################
 
@@ -42,7 +42,6 @@ http {
         listen       127.0.0.1:8080 http2 sndbuf=1m;
         server_name  localhost;
 
-        http2_max_requests 2;
         keepalive_requests 2;
 
         location / { }
@@ -74,11 +73,7 @@ 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->try_run('no keepalive_time')->plan(19);
-open STDERR, ">&", \*OLDERR;
+$t->run()->plan(19);
 
 ###############################################################################
 
@@ -116,42 +111,26 @@ select undef, undef, undef, 0.1;
 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
 is($frame->{headers}->{':status'}, 200, 'max requests limited');
 
-TODO: {
-local $TODO = 'not yet' if ($^O eq 'linux' or $^O eq 'freebsd')
-	and !$t->has_version('1.19.1');
-
 my @data = grep { $_->{type} eq "DATA" } @$frames;
 my $sum = eval join '+', map { $_->{length} } @data;
 is($sum, 400000, 'max requests limited - all data received');
 
-}
-
 ($frame) = grep { $_->{type} eq "GOAWAY" } @$frames;
 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');
 
-}
-
 # keepalive_time
 
 $s = Test::Nginx::HTTP2->new(port(8082));
@@ -204,18 +183,12 @@ select undef, undef, undef, 0.3;
 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames;
 is($frame->{headers}->{':status'}, 200, 'graceful shutdown in idle');
 
-TODO: {
-local $TODO = 'not yet' if ($^O eq 'linux' or $^O eq 'freebsd')
-	and !$t->has_version('1.19.1');
-
-my @data = grep { $_->{type} eq "DATA" } @$frames;
-my $sum = eval join '+', map { $_->{length} } @data;
+@data = grep { $_->{type} eq "DATA" } @$frames;
+$sum = eval join '+', map { $_->{length} } @data;
 is($sum, 400000, 'graceful shutdown in idle - all data received');
 
 ($frame) = grep { $_->{type} eq "GOAWAY" } @$frames;
 ok($frame, 'graceful shutdown in idle - GOAWAY');
 is($frame->{last_sid}, $sid, 'graceful shutdown in idle - GOAWAY last stream');
 
-}
-
 ###############################################################################