Skip to content

Commit

Permalink
speed up WebSocket tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Aug 7, 2012
1 parent 7b3eea4 commit 601fe8d
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions t/mojo/user_agent.t
Expand Up @@ -244,7 +244,7 @@ $message = app->log->subscribers('message')->[0];
app->log->unsubscribe(message => $message);
app->log->level('debug');
app->log->on(message => sub { $log .= pop });
$tx = $ua->get('/timeout?timeout=0.5');
$tx = $ua->get('/timeout?timeout=0.25');
app->log->level('fatal');
app->log->on(message => $message);
ok !$tx->success, 'not successful';
Expand All @@ -259,7 +259,7 @@ $ua->once(
$tx->on(
connection => sub {
my ($tx, $connection) = @_;
Mojo::IOLoop->stream($connection)->timeout(0.5);
Mojo::IOLoop->stream($connection)->timeout(0.25);
}
);
}
Expand Down
2 changes: 1 addition & 1 deletion t/mojo/websocket.t
Expand Up @@ -153,7 +153,7 @@ websocket '/deadcallback' => sub {
my $timeout;
websocket '/timeout' => sub {
my $self = shift;
Mojo::IOLoop->stream($self->tx->connection)->timeout(0.5);
Mojo::IOLoop->stream($self->tx->connection)->timeout(0.25);
$self->on(finish => sub { $timeout = 'works!' });
};

Expand Down
2 changes: 1 addition & 1 deletion t/mojolicious/websocket_lite_app.t
Expand Up @@ -36,7 +36,7 @@ get '/plain' => {text => 'Nothing to see here!'};
# WebSocket /push
websocket '/push' => sub {
my $self = shift;
my $id = Mojo::IOLoop->recurring(0.5 => sub { $self->send('push') });
my $id = Mojo::IOLoop->recurring(0.25 => sub { $self->send('push') });
$self->on(finish => sub { Mojo::IOLoop->remove($id) });
};

Expand Down

0 comments on commit 601fe8d

Please sign in to comment.