X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=t%2F30.with_pid_file.t;h=d44cb1133f3b40aa0755841f45a8f937597a55ee;hb=1474b8d3db6aeb45b37592dc823c468a5b3f3c73;hp=845f9de73f426a377adeae3c870dcbb6eef6fad5;hpb=510724ba6d30410fd17bf1962c5b563bf7dda8c1;p=gitmo%2FMooseX-Daemonize.git diff --git a/t/30.with_pid_file.t b/t/30.with_pid_file.t index 845f9de..d44cb11 100644 --- a/t/30.with_pid_file.t +++ b/t/30.with_pid_file.t @@ -3,7 +3,7 @@ use warnings; use File::Spec::Functions; -use Test::More 'no_plan'; +use Test::More; use Test::Fatal; use Test::Moose; use File::Temp qw(tempdir); @@ -96,7 +96,15 @@ if (DEBUG) { } kill INT => $p->pid; diag "killed $pid" if DEBUG; -sleep(2); + +# give the process time to be killed on slow/loaded systems +for (1..10) { + last unless kill 0 => $pid; + # sleep a little before retrying + sleep(2); +} + + if (DEBUG) { diag `ps $pid`; diag "-------"; @@ -108,3 +116,6 @@ ok(!(-e $PIDFILE), '... the PID file has been removed'); unlink $ENV{MX_DAEMON_STDOUT}; unlink $ENV{MX_DAEMON_STDERR}; + +done_testing; +