From: Chisel Wright Date: Mon, 13 May 2013 19:29:50 +0000 (-0700) Subject: RT#85229 - wait longer for processes to die, when needed X-Git-Tag: v0.18~3 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=1474b8d3db6aeb45b37592dc823c468a5b3f3c73;p=gitmo%2FMooseX-Daemonize.git RT#85229 - wait longer for processes to die, when needed --- diff --git a/t/20.core.t b/t/20.core.t index ce4daff..f3bda2c 100644 --- a/t/20.core.t +++ b/t/20.core.t @@ -87,7 +87,14 @@ 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 "-------"; diff --git a/t/21.core-back-compat.t b/t/21.core-back-compat.t index e5885a6..7a01447 100644 --- a/t/21.core-back-compat.t +++ b/t/21.core-back-compat.t @@ -88,7 +88,14 @@ 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 "-------"; diff --git a/t/30.with_pid_file.t b/t/30.with_pid_file.t index fb9629b..d44cb11 100644 --- a/t/30.with_pid_file.t +++ b/t/30.with_pid_file.t @@ -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 "-------";