Skip to content

Commit

Permalink
fix a few timing bugs in tests
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Apr 21, 2016
1 parent 8aa8fed commit f49a33a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
3 changes: 2 additions & 1 deletion Changes
@@ -1,9 +1,10 @@

6.59 2016-04-20
6.59 2016-04-21
- Improved HTML Living Standard compliance of Mojo::DOM::HTML.
- Improved Mojo::Server::Prefork to log when the manager process has been
stopped.
- Fixed a few tests to keep up with breaking changes in IO::Socket::SSL.
- Fixed a few timing bugs in tests.

6.58 2016-04-09
- Removed deprecated build_frame and parse_frame methods from
Expand Down
5 changes: 4 additions & 1 deletion t/mojo/reactor_ev.t
Expand Up @@ -129,13 +129,16 @@ ok $writable, 'handle is writable again';
ok !$timer, 'timer was not triggered';
ok !$recurring, 'recurring was not triggered again';
($readable, $writable, $timer, $recurring) = ();
my $next_tick;
is $reactor->next_tick(sub { $next_tick++ }), undef, 'returned undef';
$id = $reactor->recurring(0 => sub { $recurring++ });
is $reactor->next_tick(sub { shift->stop }), undef, 'returned undef';
$reactor->timer(0.025 => sub { shift->stop });
$reactor->start;
ok $readable, 'handle is readable again';
ok $writable, 'handle is writable again';
ok !$timer, 'timer was not triggered';
ok $recurring, 'recurring was triggered again';
ok $next_tick, 'next tick was triggered';

# Reset
$reactor->next_tick(sub { die 'Reset failed' });
Expand Down
5 changes: 4 additions & 1 deletion t/mojo/reactor_poll.t
Expand Up @@ -126,13 +126,16 @@ ok $writable, 'handle is writable again';
ok !$timer, 'timer was not triggered';
ok !$recurring, 'recurring was not triggered again';
($readable, $writable, $timer, $recurring) = ();
my $next_tick;
is $reactor->next_tick(sub { $next_tick++ }), undef, 'returned undef';
$id = $reactor->recurring(0 => sub { $recurring++ });
is $reactor->next_tick(sub { shift->stop }), undef, 'returned undef';
$reactor->timer(0.025 => sub { shift->stop });
$reactor->start;
ok $readable, 'handle is readable again';
ok $writable, 'handle is writable again';
ok !$timer, 'timer was not triggered';
ok $recurring, 'recurring was triggered again';
ok $next_tick, 'next tick was triggered';

# Reset
$reactor->next_tick(sub { die 'Reset failed' });
Expand Down

0 comments on commit f49a33a

Please sign in to comment.