Skip to content

Commit

Permalink
retry mojo
Browse files Browse the repository at this point in the history
  • Loading branch information
FGasper committed May 23, 2022
1 parent 21cc3eb commit d286e6f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 15 deletions.
1 change: 1 addition & 0 deletions MANIFEST
Expand Up @@ -62,3 +62,4 @@ t/lib/DBusSession.pm
t/lib/MockDBusServer.pm
t/mojo_uncaught_failure.t
t/pause_resume.t
t/pause_resume_mojo.t
26 changes: 11 additions & 15 deletions t/pause_resume_mojo.t
Expand Up @@ -46,12 +46,12 @@ SKIP: {

$bus_name = $messenger->get_unique_bus_name();

return Promise::ES6->new( sub {
return Mojo::Promise->new( sub {
my ($y, $n) = @_;

my $timer = AnyEvent->timer(
after => 5,
cb => sub {
my $timer_id = Mojo::IOLoop->timer(
5,
sub {
$n->('timed out');
},
);
Expand Down Expand Up @@ -106,12 +106,9 @@ SKIP: {
return Promise::ES6->new( sub {
my ($y, $n) = @_;

my $timer;
$timer = AnyEvent->timer(
after => 1,
my $timer_id = Mojo::IOLoop->timer(
1,
cb => sub {
undef $timer;

is(
"@received_while_paused",
q<>,
Expand All @@ -132,10 +129,10 @@ SKIP: {
return Promise::ES6->new( sub {
my ($y, $n) = @_;

my $timer;
my $timer_id;

$on_signal_cr = sub {
undef $timer;
Mojo::IOLoop->remove($timer_id);
push @received_after_resume, shift;
$y->();
};
Expand All @@ -144,10 +141,9 @@ SKIP: {
$messenger->resume();
diag 'resumed';

$timer = AnyEvent->timer(
after => 10,
cb => sub {
undef $timer;
$timer_id = Mojo::IOLoop->timer(
5,
sub {
$n->('timeout waiting for D-Bus signal!');
},
);
Expand Down

0 comments on commit d286e6f

Please sign in to comment.