X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FObject-Remote.git;a=blobdiff_plain;f=t%2Fwatchdog.t;h=bd8f576b32f8ad832ef1ed96debdc66f72a23a23;hp=8615f0e65f27d96d324d974a98f386f1359bf32c;hb=dd6e1327e96d5488e34f7519d9d3290627c9bbe8;hpb=09130cd025586aa10cb57c33d3ae899a7cc7e185 diff --git a/t/watchdog.t b/t/watchdog.t index 8615f0e..bd8f576 100644 --- a/t/watchdog.t +++ b/t/watchdog.t @@ -1,14 +1,14 @@ use strictures 1; use Test::More; -require 't/logsetup.pl'; +$ENV{OBJECT_REMOTE_TEST_LOGGER} = 1; use Object::Remote::Connection; -use Object::Remote::FromData; +use Object::Remote::FromData; $SIG{ALRM} = sub { fail("Watchdog killed remote process in time"); die "test failed" }; -my $conn = Object::Remote::Connection->conn_from_spec("-", watchdog_timeout => 1)->connect; +my $conn = Object::Remote->connect("-", watchdog_timeout => 1); my $remote = HangClass->new::on($conn); @@ -19,9 +19,9 @@ alarm(3); eval { $remote->hang }; -like($@, qr/^Object::Remote connection lost: eof/, "Correct error message"); +like($@, qr/^Object::Remote connection lost: (?:eof|.*Broken pipe)/, "Correct error message"); -done_testing; +done_testing; __DATA__ @@ -30,12 +30,12 @@ package HangClass; use Moo; sub alive { - return 1; + return 1; } sub hang { while(1) { - sleep(1); + sleep(1); } }