# HG changeset patch # User Sergey Kandaurov # Date 1481546749 -10800 # Node ID f72f43eda2a6e51ac75fc9a912d93d2c2d44f68e # Parent a5e428f4440df7ed85217ee9722253a9d9757856 Tests: simplified nginx reload in HTTP/2 GOAWAY tests. diff --git a/h2.t b/h2.t --- a/h2.t +++ b/h2.t @@ -85,9 +85,6 @@ http { charset utf-8; return 200; } - location /pid { - return 200 "pid $pid"; - } } server { @@ -1072,7 +1069,7 @@ local $TODO = 'not yet' unless $t->has_v $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 gunzip_like { } } -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; - } -} - ###############################################################################