/**
  * Test if the process is still running
  * @param JobExecution $jobExecution
  *
  * @return bool
  */
 protected function processIsRunning(JobExecution $jobExecution)
 {
     $pid = intval($jobExecution->getPid());
     if ($pid <= 0) {
         throw new \InvalidArgumentException('The job execution PID is not valid');
     }
     exec(sprintf('ps -p %s', $pid), $output, $returnCode);
     return 0 === $returnCode;
 }