Mercurial > hg > nginx-tests
comparison worker_shutdown_timeout.t @ 1206:c99c1f43cb15
Tests: reload() introduced in Test::Nginx.
This method replaces ad-hoc solutions to reload nginx, and adds win32 support.
author | Sergey Kandaurov <pluknet@nginx.com> |
---|---|
date | Wed, 09 Aug 2017 15:57:38 +0300 |
parents | feb91ae3fca3 |
children | 766bcbb632ee |
comparison
equal
deleted
inserted
replaced
1205:c0fa3f818103 | 1206:c99c1f43cb15 |
---|---|
21 | 21 |
22 ############################################################################### | 22 ############################################################################### |
23 | 23 |
24 select STDERR; $| = 1; | 24 select STDERR; $| = 1; |
25 select STDOUT; $| = 1; | 25 select STDOUT; $| = 1; |
26 | |
27 plan(skip_all => 'win32') if $^O eq 'MSWin32'; | |
28 | 26 |
29 my $t = Test::Nginx->new()->has(qw/http/) | 27 my $t = Test::Nginx->new()->has(qw/http/) |
30 ->write_file_expand('nginx.conf', <<'EOF'); | 28 ->write_file_expand('nginx.conf', <<'EOF'); |
31 | 29 |
32 %%TEST_GLOBALS%% | 30 %%TEST_GLOBALS%% |
56 | 54 |
57 my $s = http('', start => 1); | 55 my $s = http('', start => 1); |
58 | 56 |
59 select undef, undef, undef, 0.2; | 57 select undef, undef, undef, 0.2; |
60 | 58 |
61 kill 'HUP', $t->read_file('nginx.pid'); | 59 $t->reload(); |
62 | 60 |
63 if (IO::Select->new($s)->can_read(5)) { | 61 if (IO::Select->new($s)->can_read(5)) { |
64 Test::Nginx::log_core('||', "select: can_read"); | 62 Test::Nginx::log_core('||', "select: can_read"); |
65 } | 63 } |
66 | 64 |