Skip to content

Commit

Permalink
test worker restarts too
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 25, 2016
1 parent 80a4f3f commit 794939f
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions t/mojo/hypnotoad.t
Expand Up @@ -130,8 +130,10 @@ app->log->path('$log');
plugin Config => {
default => {
hypnotoad => {
accepts => 2,
inactivity_timeout => 3,
listen => ['http://127.0.0.1:$port1', 'http://127.0.0.1:$port2'],
requests => 1,
workers => 1
}
}
Expand Down Expand Up @@ -174,32 +176,32 @@ while (1) {
# Application has been reloaded
$tx = $ua->get("http://127.0.0.1:$port1/hello");
ok $tx->is_finished, 'transaction is finished';
ok $tx->keep_alive, 'connection will be kept alive';
ok !$tx->keep_alive, 'connection will not be kept alive';
ok !$tx->kept_alive, 'connection was not kept alive';
is $tx->res->code, 200, 'right status';
is $tx->res->body, 'Hello World!', 'right content';

# Application has been reloaded (second port)
$tx = $ua->get("http://127.0.0.1:$port2/hello");
ok $tx->is_finished, 'transaction is finished';
ok $tx->keep_alive, 'connection will be kept alive';
ok !$tx->keep_alive, 'connection will not be kept alive';
ok !$tx->kept_alive, 'connection was not kept alive';
is $tx->res->code, 200, 'right status';
is $tx->res->body, 'Hello World!', 'right content';

# Same result
$tx = $ua->get("http://127.0.0.1:$port1/hello");
ok $tx->is_finished, 'transaction is finished';
ok $tx->keep_alive, 'connection will be kept alive';
ok $tx->kept_alive, 'connection was kept alive';
ok !$tx->keep_alive, 'connection will not be kept alive';
ok !$tx->kept_alive, 'connection was not kept alive';
is $tx->res->code, 200, 'right status';
is $tx->res->body, 'Hello World!', 'right content';

# Same result (second port)
$tx = $ua->get("http://127.0.0.1:$port2/hello");
ok $tx->is_finished, 'transaction is finished';
ok $tx->keep_alive, 'connection will be kept alive';
ok $tx->kept_alive, 'connection was kept alive';
ok !$tx->keep_alive, 'connection will not be kept alive';
ok !$tx->kept_alive, 'connection was not kept alive';
is $tx->res->code, 200, 'right status';
is $tx->res->body, 'Hello World!', 'right content';

Expand Down

0 comments on commit 794939f

Please sign in to comment.