diff worker_shutdown_timeout.t @ 1157:06bb6af4324e

Tests: adjusted worker_shutdown_timeout test. Use select on socket to speed up test, adjust read timeout for slow hosts.
author Sergey Kandaurov <pluknet@nginx.com>
date Thu, 30 Mar 2017 15:26:09 +0300
parents b1c2857d2e97
children 4ed2226d47de
line wrap: on
line diff
--- a/worker_shutdown_timeout.t
+++ b/worker_shutdown_timeout.t
@@ -12,6 +12,8 @@ use strict;
 
 use Test::More;
 
+use IO::Select;
+
 BEGIN { use FindBin; chdir($FindBin::Bin); }
 
 use lib 'lib';
@@ -55,7 +57,7 @@ EOF
 my $s = http('', start => 1);
 
 kill 'HUP', $t->read_file('nginx.pid');
-sleep 1;
+IO::Select->new($s)->can_read(2);
 
 is(http_get('/', socket => $s) || '', '', 'worker_shutdown_timeout');