Mercurial > hg > nginx-tests
comparison h2_proxy_cache.t @ 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 | 99f93be57416 |
children | 3c5d3b384d3f |
comparison
equal
deleted
inserted
replaced
995:35739834ecd9 | 996:ec9b99d3e22e |
---|---|
21 ############################################################################### | 21 ############################################################################### |
22 | 22 |
23 select STDERR; $| = 1; | 23 select STDERR; $| = 1; |
24 select STDOUT; $| = 1; | 24 select STDOUT; $| = 1; |
25 | 25 |
26 my $t = Test::Nginx->new()->has(qw/http http_v2 proxy cache/)->plan(12) | 26 my $t = Test::Nginx->new()->has(qw/http http_v2 proxy cache rewrite/)->plan(12) |
27 ->write_file_expand('nginx.conf', <<'EOF'); | 27 ->write_file_expand('nginx.conf', <<'EOF'); |
28 | 28 |
29 %%TEST_GLOBALS%% | 29 %%TEST_GLOBALS%% |
30 | 30 |
31 daemon off; | 31 daemon off; |
55 location /proxy_buffering_off { | 55 location /proxy_buffering_off { |
56 proxy_pass http://127.0.0.1:8081/; | 56 proxy_pass http://127.0.0.1:8081/; |
57 proxy_cache NAME; | 57 proxy_cache NAME; |
58 proxy_cache_valid 1m; | 58 proxy_cache_valid 1m; |
59 proxy_buffering off; | 59 proxy_buffering off; |
60 } | |
61 location / { | |
62 if ($arg_slow) { | |
63 set $limit_rate 200; | |
64 } | |
60 } | 65 } |
61 } | 66 } |
62 } | 67 } |
63 | 68 |
64 EOF | 69 EOF |
151 | 156 |
152 # client cancels stream with a cacheable request that was sent to upstream | 157 # client cancels stream with a cacheable request that was sent to upstream |
153 # HEADERS should not be produced for the canceled stream | 158 # HEADERS should not be produced for the canceled stream |
154 | 159 |
155 $s = Test::Nginx::HTTP2->new(); | 160 $s = Test::Nginx::HTTP2->new(); |
156 $sid = $s->new_stream({ path => '/cache/t.html?3' }); | 161 $sid = $s->new_stream({ path => '/cache/t.html?slow=1' }); |
157 | 162 |
158 $s->h2_rst($sid, 8); | 163 $s->h2_rst($sid, 8); |
159 | 164 |
160 $frames = $s->read(all => [{ sid => $sid, fin => 0x4 }], wait => 0.2); | 165 $frames = $s->read(all => [{ sid => $sid, fin => 0x4 }], wait => 1.2); |
161 | 166 |
162 TODO: { | 167 TODO: { |
163 local $TODO = 'not yet'; | 168 local $TODO = 'not yet'; |
164 | 169 |
165 ok(!(grep { $_->{type} eq "HEADERS" } @$frames), 'no headers'); | 170 ok(!(grep { $_->{type} eq "HEADERS" } @$frames), 'no headers'); |