Skip to content

Commit

Permalink
make sure values are passed along to the event loop
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 19, 2015
1 parent 47f5a95 commit 45f1584
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions t/mojo/prefork.t
Expand Up @@ -83,8 +83,10 @@ ok !-e $pid, 'process id file has been removed';
# One worker and immediate shutdown
$port = Mojo::IOLoop::Server->generate_port;
$prefork = Mojo::Server::Prefork->new(
accepts => 500,
heartbeat_interval => 0.5,
listen => ["http://*:$port"],
multi_accept => 3,
workers => 1
);
$prefork->unsubscribe('request');
Expand All @@ -107,6 +109,8 @@ $prefork->once(
$prefork->on(reap => sub { push @reap, pop });
$prefork->on(finish => sub { $graceful = pop });
$prefork->run;
is $prefork->ioloop->max_accepts, 500, 'right value';
is $prefork->ioloop->multi_accept, 3, 'right value';
is scalar @spawn, 1, 'one worker spawned';
is scalar @reap, 1, 'one worker reaped';
ok !$graceful, 'server has been stopped immediately';
Expand Down

0 comments on commit 45f1584

Please sign in to comment.