Mercurial > hg > nginx-tests
comparison h2.t @ 1647:35beaf85de72
Tests: sorted h2.t tests.
A test for partial request body is moved closer to relatives.
This also fixes graceful shutdown tests that depend on timings.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Mon, 08 Feb 2021 20:17:23 +0300 |
parents | f145dce55f32 |
children | 48d8c16d48ea |
comparison
equal
deleted
inserted
replaced
1646:5b1fa6e32549 | 1647:35beaf85de72 |
---|---|
693 $frames = $s->read(all => [{ type => 'PING' }]); | 693 $frames = $s->read(all => [{ type => 'PING' }]); |
694 | 694 |
695 ($frame) = grep { $_->{type} eq "PING" && $_->{flags} & 0x1 } @$frames; | 695 ($frame) = grep { $_->{type} eq "PING" && $_->{flags} & 0x1 } @$frames; |
696 ok($frame, 'client body timeout - PING'); | 696 ok($frame, 'client body timeout - PING'); |
697 | 697 |
698 # partial request body data frame with connection close after body timeout | |
699 | |
700 $s = Test::Nginx::HTTP2->new(port(8087)); | |
701 $sid = $s->new_stream({ path => '/proxy/t2.html', body_more => 1 }); | |
702 $s->h2_body('TEST', { split => [ 12 ], abort => 1 }); | |
703 | |
704 select undef, undef, undef, 1.1; | |
705 undef $s; | |
706 | |
698 # proxied request with logging pristine request header field (e.g., referer) | 707 # proxied request with logging pristine request header field (e.g., referer) |
699 | 708 |
700 $s = Test::Nginx::HTTP2->new(); | 709 $s = Test::Nginx::HTTP2->new(); |
701 $sid = $s->new_stream({ headers => [ | 710 $sid = $s->new_stream({ headers => [ |
702 { name => ':method', value => 'GET' }, | 711 { name => ':method', value => 'GET' }, |
1153 | 1162 |
1154 my $grace3 = Test::Nginx::HTTP2->new(port(8085)); | 1163 my $grace3 = Test::Nginx::HTTP2->new(port(8085)); |
1155 $sid = $grace3->new_stream({ path => '/proxy2/t2.html', body_more => 1 }); | 1164 $sid = $grace3->new_stream({ path => '/proxy2/t2.html', body_more => 1 }); |
1156 $grace3->h2_body('TEST', { body_more => 1 }); | 1165 $grace3->h2_body('TEST', { body_more => 1 }); |
1157 | 1166 |
1158 # partial request body data frame with connection close after body timeout | |
1159 | |
1160 my $grace4 = Test::Nginx::HTTP2->new(port(8087)); | |
1161 $sid = $grace4->new_stream({ path => '/proxy/t2.html', body_more => 1 }); | |
1162 $grace4->h2_body('TEST', { split => [ 12 ], abort => 1 }); | |
1163 | |
1164 select undef, undef, undef, 1.1; | |
1165 undef $grace4; | |
1166 | |
1167 # GOAWAY without awaiting active streams, further streams ignored | 1167 # GOAWAY without awaiting active streams, further streams ignored |
1168 | 1168 |
1169 $s = Test::Nginx::HTTP2->new(port(8080)); | 1169 $s = Test::Nginx::HTTP2->new(port(8080)); |
1170 $sid = $s->new_stream({ path => '/t1.html' }); | 1170 $sid = $s->new_stream({ path => '/t1.html' }); |
1171 $s->read(all => [{ sid => $sid, length => 2**16 - 1 }]); | 1171 $s->read(all => [{ sid => $sid, length => 2**16 - 1 }]); |