From: Karen Etheridge Date: Mon, 3 Feb 2014 04:35:57 +0000 (-0800) Subject: fix test that is prone to failure on smokers X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=de7ff63e16b4383d35f97c33ba8069bbf99c735a;p=gitmo%2FMooseX-Daemonize.git fix test that is prone to failure on smokers --- diff --git a/Changes b/Changes index 7b311b9..a34ce1e 100644 --- a/Changes +++ b/Changes @@ -1,6 +1,8 @@ Revision history for {{$dist->name}} {{$NEXT}} + - fix buggy test that does not try hard enough to look for a nonexistent + pid (ether) 0.18 2013-05-13 19:34:52Z - make tests a bit more tolerant of slow systems, by waiting longer for diff --git a/t/10.pidfile.t b/t/10.pidfile.t index e515bc6..c88a346 100644 --- a/t/10.pidfile.t +++ b/t/10.pidfile.t @@ -66,7 +66,11 @@ BEGIN { } { - my $PID = 9999; + # find a pid that doesn't currently exist - start by looking at our own + # and going backwards (not 100% reliable but better than hardcoding one) + my $PID = $$; + do { $PID--; $PID = 2**32 if $PID < 1 } while kill(0, $PID); + diag 'assigning the non-existent pid ' . $PID; my $f = MooseX::Daemonize::Pid::File->new( file => [ 't', 'baz.pid' ],