Mercurial > hg > nginx-tests
diff h2.t @ 1092:f72f43eda2a6
Tests: simplified nginx reload in HTTP/2 GOAWAY tests.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Mon, 12 Dec 2016 15:45:49 +0300 |
parents | efccab043dd3 |
children | d42cc683970d |
line wrap: on
line diff
--- a/h2.t Mon Dec 12 10:51:33 2016 +0300 +++ b/h2.t Mon Dec 12 15:45:49 2016 +0300 @@ -85,9 +85,6 @@ charset utf-8; return 200; } - location /pid { - return 200 "pid $pid"; - } } server { @@ -1072,7 +1069,7 @@ $sid = $s->new_stream({ path => '/t1.html' }); $s->read(all => [{ sid => $sid, length => 2**16 - 1 }]); -hup('/pid', 8081, $t); +kill 'HUP', $t->read_file('nginx.pid'); $frames = $s->read(all => [{ type => 'GOAWAY' }]); @@ -1135,18 +1132,4 @@ } } -sub hup { - my ($uri, $port, $t) = @_; - - my $sock = sub { IO::Socket::INET->new('127.0.0.1:' . port(shift)) }; - my ($pid) = http_get($uri, socket => $sock->($port)) =~ /pid (\d+)/; - - kill 'HUP', $t->read_file('nginx.pid'); - - for (1 .. 20) { - last if http_get($uri, socket => $sock->($port)) !~ /pid $pid/; - select undef, undef, undef, 0.2; - } -} - ###############################################################################