Mercurial > hg > nginx-tests
comparison h2.t @ 1070:efccab043dd3
Tests: removed TODOs for fixes merged in 1.10.2.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Mon, 24 Oct 2016 15:59:23 +0300 |
parents | 23418577df58 |
children | f72f43eda2a6 |
comparison
equal
deleted
inserted
replaced
1069:1b11a12be179 | 1070:efccab043dd3 |
---|---|
25 select STDERR; $| = 1; | 25 select STDERR; $| = 1; |
26 select STDOUT; $| = 1; | 26 select STDOUT; $| = 1; |
27 | 27 |
28 my $t = Test::Nginx->new()->has(qw/http http_v2 proxy rewrite charset gzip/) | 28 my $t = Test::Nginx->new()->has(qw/http http_v2 proxy rewrite charset gzip/) |
29 ->plan(141); | 29 ->plan(141); |
30 | |
31 # Some systems return EINVAL on zero writev iovcnt per POSIX, while others not | |
32 | |
33 $t->todo_alerts() if ($^O eq 'darwin' or $^O eq 'netbsd') | |
34 and !$t->has_version('1.11.3'); | |
35 | 30 |
36 $t->write_file_expand('nginx.conf', <<'EOF'); | 31 $t->write_file_expand('nginx.conf', <<'EOF'); |
37 | 32 |
38 %%TEST_GLOBALS%% | 33 %%TEST_GLOBALS%% |
39 | 34 |
791 @data = grep { $_->{type} eq "DATA" } @$frames; | 786 @data = grep { $_->{type} eq "DATA" } @$frames; |
792 $sum = eval join '+', map { $_->{length} } @data; | 787 $sum = eval join '+', map { $_->{length} } @data; |
793 is($sum, 5000000, 'large response - DATA'); | 788 is($sum, 5000000, 'large response - DATA'); |
794 | 789 |
795 # Make sure http2 write handler doesn't break a connection. | 790 # Make sure http2 write handler doesn't break a connection. |
796 # Some buggy systems tolerate ill-use of writev() triggered by write handler, | |
797 # while others, such as darwin and NetBSD, follow POSIX strictly, which causes | |
798 # a connection to close in nginx. While this also breaks the 'no alerts' test, | |
799 # it doesn't suit well, because error.log is currently polluted with much more | |
800 # alerts due to other various bugs in ngx_http_v2_module. We catch it here in | |
801 # a separate test as well to make it clear. | |
802 | |
803 SKIP: { | |
804 skip 'tolerant operating system', 1 unless $^O eq 'darwin' or $^O eq 'netbsd'; | |
805 | |
806 TODO: { | |
807 local $TODO = 'not yet' unless $t->has_version('1.11.3'); | |
808 | 791 |
809 $sid = $s->new_stream(); | 792 $sid = $s->new_stream(); |
810 $frames = $s->read(all => [{ sid => $sid, fin => 1 }]); | 793 $frames = $s->read(all => [{ sid => $sid, fin => 1 }]); |
811 | 794 |
812 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames; | 795 ($frame) = grep { $_->{type} eq "HEADERS" } @$frames; |
813 is($frame->{headers}->{':status'}, 200, 'new stream after large response'); | 796 is($frame->{headers}->{':status'}, 200, 'new stream after large response'); |
814 | |
815 } | |
816 | |
817 } | |
818 | 797 |
819 # write event send timeout | 798 # write event send timeout |
820 | 799 |
821 $s = Test::Nginx::HTTP2->new(port(8086)); | 800 $s = Test::Nginx::HTTP2->new(port(8086)); |
822 $sid = $s->new_stream({ path => '/tbig.html' }); | 801 $sid = $s->new_stream({ path => '/tbig.html' }); |
1132 | 1111 |
1133 $frames = $s->read(all => [{ type => 'GOAWAY' }]); | 1112 $frames = $s->read(all => [{ type => 'GOAWAY' }]); |
1134 ($frame) = grep { $_->{type} eq "GOAWAY" } @$frames; | 1113 ($frame) = grep { $_->{type} eq "GOAWAY" } @$frames; |
1135 ok($frame, 'GOAWAY on connection close - idle stream'); | 1114 ok($frame, 'GOAWAY on connection close - idle stream'); |
1136 | 1115 |
1137 TODO: { | |
1138 local $TODO = 'not yet' unless $t->has_version('1.11.3'); | |
1139 | |
1140 $frames = $active->read(all => [{ type => 'GOAWAY' }]); | 1116 $frames = $active->read(all => [{ type => 'GOAWAY' }]); |
1141 ($frame) = grep { $_->{type} eq "GOAWAY" } @$frames; | 1117 ($frame) = grep { $_->{type} eq "GOAWAY" } @$frames; |
1142 ok($frame, 'GOAWAY on connection close - active stream'); | 1118 ok($frame, 'GOAWAY on connection close - active stream'); |
1143 | |
1144 } | |
1145 | 1119 |
1146 ############################################################################### | 1120 ############################################################################### |
1147 | 1121 |
1148 sub gunzip_like { | 1122 sub gunzip_like { |
1149 my ($in, $re, $name) = @_; | 1123 my ($in, $re, $name) = @_; |