Navigation Menu

Skip to content

Commit

Permalink
the multi-accept test is a little too unreliable
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Mar 3, 2016
1 parent 89e7787 commit 1757f4d
Showing 1 changed file with 0 additions and 27 deletions.
27 changes: 0 additions & 27 deletions t/mojo/daemon.t
Expand Up @@ -306,33 +306,6 @@ $loop->start;
ok $accepting[0], 'accepting connections';
ok !$accepting[1], 'connection limit reached';

# Multi-accept and connection limit
$loop = Mojo::IOLoop->new;
$daemon = Mojo::Server::Daemon->new(
app => $app,
ioloop => $loop,
listen => ['http://127.0.0.1'],
max_clients => 2,
silent => 1
)->start;
$acceptor = $loop->acceptor($daemon->acceptors->[0]);
@accepting = ();
$acceptor->on(
accept => sub {
my $acceptor = shift;
$loop->next_tick(
sub {
push @accepting, $acceptor->is_accepting;
shift->stop if @accepting == 2;
}
);
}
);
$loop->client({port => $acceptor->port} => sub { }) for 1 .. 2;
$loop->start;
ok !$accepting[0], 'connection limit reached';
ok !$accepting[1], 'connection limit reached';

# Abstract methods
eval { Mojo::Server->run };
like $@, qr/Method "run" not implemented by subclass/, 'right error';
Expand Down

0 comments on commit 1757f4d

Please sign in to comment.