Skip to content

Commit e54c7ca

Browse files
author
Chris Boulton
committed
only remove pid file during tests if exists
1 parent 998b468 commit e54c7ca

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

test/Resque/Tests/bootstrap.php

+7-5
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,13 @@ function killRedis($pid)
5959
}
6060

6161
$pidFile = TEST_MISC . '/' . $matches[1];
62-
$pid = trim(file_get_contents($pidFile));
63-
posix_kill((int) $pid, 9);
64-
65-
if(is_file($pidFile)) {
66-
unlink($pidFile);
62+
if (file_exists($pidFile)) {
63+
$pid = trim(file_get_contents($pidFile));
64+
posix_kill((int) $pid, 9);
65+
66+
if(is_file($pidFile)) {
67+
unlink($pidFile);
68+
}
6769
}
6870

6971
// Remove the redis database

0 commit comments

Comments
 (0)