X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FObject-Remote.git;a=blobdiff_plain;f=t%2Fwatchdog_fatnode.t;h=edc73ab1c116f1037fd5a75dde6e1e45e3c84981;hp=2b73ce65fa837c6a75f088188722cf577a399ea7;hb=HEAD;hpb=abef6e5b046572e5130c41ce62d7dde01978562f diff --git a/t/watchdog_fatnode.t b/t/watchdog_fatnode.t index 2b73ce6..edc73ab 100644 --- a/t/watchdog_fatnode.t +++ b/t/watchdog_fatnode.t @@ -3,12 +3,10 @@ use Test::More; $ENV{OBJECT_REMOTE_TEST_LOGGER} = 1; -use Object::Remote::Connector::Local; +use Object::Remote::Connector::Local; $SIG{ALRM} = sub { die "alarm signal\n" }; -open(my $nullfh, '>', '/dev/null') or die "Could not open /dev/null: $!"; - my $fatnode_text = Object::Remote::Connector::Local->new(timeout => 1)->fatnode_text; #this simulates a node that has hung before it reaches @@ -17,14 +15,13 @@ my $fatnode_text = Object::Remote::Connector::Local->new(timeout => 1)->fatnode_ #if it's not handled right eval { no warnings 'once'; - local *STDOUT = $nullfh; - $Object::Remote::FatNode::INHIBIT_RUN_NODE = 1; + $Object::Remote::FatNode::INHIBIT_RUN_NODE = 1; eval $fatnode_text; - + if ($@) { die "could not eval fatnode text: $@"; - } - + } + while(1) { sleep(1); } @@ -32,5 +29,5 @@ eval { is($@, "alarm signal\n", "Alarm handler was invoked"); -done_testing; +done_testing;