changeset 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 d12c45f14102
children 3a3a7f68c6d7
files worker_shutdown_timeout.t
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
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');