Mercurial > hg > nginx-tests
comparison h2.t @ 1066:23418577df58
Tests: tweak HTTP/2 GOAWAY test with no new stream after reload.
Wait for GOAWAY first before opening a stream.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Fri, 21 Oct 2016 15:27:44 +0300 |
parents | 2d4343a47c6d |
children | efccab043dd3 |
comparison
equal
deleted
inserted
replaced
1065:2d4343a47c6d | 1066:23418577df58 |
---|---|
1093 $sid = $s->new_stream({ path => '/t1.html' }); | 1093 $sid = $s->new_stream({ path => '/t1.html' }); |
1094 $s->read(all => [{ sid => $sid, length => 2**16 - 1 }]); | 1094 $s->read(all => [{ sid => $sid, length => 2**16 - 1 }]); |
1095 | 1095 |
1096 hup('/pid', 8081, $t); | 1096 hup('/pid', 8081, $t); |
1097 | 1097 |
1098 $frames = $s->read(all => [{ type => 'GOAWAY' }]); | |
1099 | |
1100 ($frame) = grep { $_->{type} eq "GOAWAY" } @$frames; | |
1101 is($frame->{last_sid}, $sid, 'GOAWAY with active stream - last sid'); | |
1102 | |
1098 $sid2 = $s->new_stream(); | 1103 $sid2 = $s->new_stream(); |
1099 $frames = $s->read(all => [{ sid => $sid2, fin => 0x4 }], wait => 0.5); | 1104 $frames = $s->read(all => [{ sid => $sid2, fin => 0x4 }], wait => 0.5); |
1100 | 1105 |
1101 ($frame) = grep { $_->{type} eq 'HEADERS' } @$frames; | 1106 ($frame) = grep { $_->{type} eq 'HEADERS' } @$frames; |
1102 is($frame, undef, 'GOAWAY with active stream - no new stream'); | 1107 is($frame, undef, 'GOAWAY with active stream - no new stream'); |
1103 | |
1104 $frames = $s->read(all => [{ type => 'GOAWAY' }]) | |
1105 unless grep { $_->{type} eq "GOAWAY" } @$frames; | |
1106 | |
1107 ($frame) = grep { $_->{type} eq "GOAWAY" } @$frames; | |
1108 is($frame->{last_sid}, $sid, 'GOAWAY with active stream - last sid'); | |
1109 | 1108 |
1110 } | 1109 } |
1111 | 1110 |
1112 $s->h2_window(100, $sid); | 1111 $s->h2_window(100, $sid); |
1113 $s->h2_window(100); | 1112 $s->h2_window(100); |