only remove pid file during tests if exists

This commit is contained in:
Chris Boulton 2012-04-19 22:39:55 +10:00
parent 998b46887a
commit e54c7ca99a

View File

@ -59,12 +59,14 @@ function killRedis($pid)
} }
$pidFile = TEST_MISC . '/' . $matches[1]; $pidFile = TEST_MISC . '/' . $matches[1];
if (file_exists($pidFile)) {
$pid = trim(file_get_contents($pidFile)); $pid = trim(file_get_contents($pidFile));
posix_kill((int) $pid, 9); posix_kill((int) $pid, 9);
if(is_file($pidFile)) { if(is_file($pidFile)) {
unlink($pidFile); unlink($pidFile);
} }
}
// Remove the redis database // Remove the redis database
if(!preg_match('#^\s*dir\s+([^\s]+)#m', $config, $matches)) { if(!preg_match('#^\s*dir\s+([^\s]+)#m', $config, $matches)) {