From e54c7ca99a7a6bdd8105a459e0029c6840cd3b7f Mon Sep 17 00:00:00 2001 From: Chris Boulton Date: Thu, 19 Apr 2012 22:39:55 +1000 Subject: [PATCH] only remove pid file during tests if exists --- test/Resque/Tests/bootstrap.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/test/Resque/Tests/bootstrap.php b/test/Resque/Tests/bootstrap.php index ad709c6..0efa2a8 100644 --- a/test/Resque/Tests/bootstrap.php +++ b/test/Resque/Tests/bootstrap.php @@ -59,11 +59,13 @@ function killRedis($pid) } $pidFile = TEST_MISC . '/' . $matches[1]; - $pid = trim(file_get_contents($pidFile)); - posix_kill((int) $pid, 9); - - if(is_file($pidFile)) { - unlink($pidFile); + if (file_exists($pidFile)) { + $pid = trim(file_get_contents($pidFile)); + posix_kill((int) $pid, 9); + + if(is_file($pidFile)) { + unlink($pidFile); + } } // Remove the redis database