changeset 996:ec9b99d3e22e

Tests: fixed HTTP/2 test for no HEADERS due to canceled stream. Made sure to send RST_STREAM before HEADERS could be sent.
author Sergey Kandaurov <pluknet@nginx.com>
date Tue, 26 Jul 2016 20:41:26 +0300
parents 35739834ecd9
children 3c5d3b384d3f
files h2_proxy_cache.t
diffstat 1 files changed, 8 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/h2_proxy_cache.t
+++ b/h2_proxy_cache.t
@@ -23,7 +23,7 @@ use Test::Nginx::HTTP2;
 select STDERR; $| = 1;
 select STDOUT; $| = 1;
 
-my $t = Test::Nginx->new()->has(qw/http http_v2 proxy cache/)->plan(12)
+my $t = Test::Nginx->new()->has(qw/http http_v2 proxy cache rewrite/)->plan(12)
 	->write_file_expand('nginx.conf', <<'EOF');
 
 %%TEST_GLOBALS%%
@@ -58,6 +58,11 @@ http {
             proxy_cache_valid 1m;
             proxy_buffering off;
         }
+        location / {
+            if ($arg_slow) {
+                set $limit_rate 200;
+            }
+        }
     }
 }
 
@@ -153,11 +158,11 @@ ok(!grep ({ $_->{type} eq "DATA" } @$fra
 # HEADERS should not be produced for the canceled stream
 
 $s = Test::Nginx::HTTP2->new();
-$sid = $s->new_stream({ path => '/cache/t.html?3' });
+$sid = $s->new_stream({ path => '/cache/t.html?slow=1' });
 
 $s->h2_rst($sid, 8);
 
-$frames = $s->read(all => [{ sid => $sid, fin => 0x4 }], wait => 0.2);
+$frames = $s->read(all => [{ sid => $sid, fin => 0x4 }], wait => 1.2);
 
 TODO: {
 local $TODO = 'not yet';