checkTimeout() public method

In case you run a background process (with the start method), you should trigger this method regularly to ensure the process timeout
public checkTimeout ( )
Beispiel #1
0
 /**
  * Check if process is not running longer then specified timeout, return error message if so.
  * @param Process $process Process instance
  * @param string $testClass Name of tested class
  * @return string|null Error message if process timeout exceeded
  */
 protected function checkProcessTimeout(Process $process, $testClass)
 {
     try {
         $process->checkTimeout();
     } catch (ProcessTimedOutException $e) {
         return sprintf('[%s]: Process for class "%s" exceeded the time out of %d seconds and was killed.', date("Y-m-d H:i:s"), $testClass, $e->getExceededTimeout());
     }
 }