X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FObject-Remote.git;a=blobdiff_plain;f=t%2Fstart_core.t;h=b50b9f3642dc5c3f6471392c67dff83d4f1df51c;hp=4c63f4baedc1afe8af77d63211dae89c45b06d5d;hb=5ccce2d5c1fb651f83c73c811069003e4a591a53;hpb=a711172670b40e3a6033791ef6a747031ec7464b diff --git a/t/start_core.t b/t/start_core.t index 4c63f4b..b50b9f3 100644 --- a/t/start_core.t +++ b/t/start_core.t @@ -3,6 +3,8 @@ use Test::More; use Object::Remote; use File::Spec; +$ENV{OBJECT_REMOTE_TEST_LOGGER} = 1; + { package S1S; @@ -22,6 +24,10 @@ use File::Spec; our $C; sub get_s2 { + shift->maybe::start::_real_get_s2; + } + + sub _real_get_s2 { future { my $f = shift; $C = sub { $f->done(S2F->new); undef($f); undef($C); }; @@ -79,13 +85,14 @@ is($res, 'S3', 'Asynchronous code ok'); is(S1S->get_s2->get_s3, 'S3', 'Sync without start'); -open my $fh, '<', File::Spec->devnull; - -Object::Remote->current_loop->watch_io( - handle => $fh, - on_read_ready => sub { - $S1F::C->() if defined $S1F::C; - $S2F::C->() if defined $S2F::C; +Object::Remote->current_loop->watch_time( + after => 0.1, + code => sub { + $S1F::C->(); + Object::Remote->current_loop->watch_time( + after => 0.1, + code => sub { $S2F::C->() } + ); } );