You are here

public function AbstractProcessTest::testStopWithTimeoutIsActuallyWorking in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/process/Tests/AbstractProcessTest.php \Symfony\Component\Process\Tests\AbstractProcessTest::testStopWithTimeoutIsActuallyWorking()
1 call to AbstractProcessTest::testStopWithTimeoutIsActuallyWorking()
SimpleProcessTest::testStopWithTimeoutIsActuallyWorking in vendor/symfony/process/Tests/SimpleProcessTest.php
3 methods override AbstractProcessTest::testStopWithTimeoutIsActuallyWorking()
SigchildDisabledProcessTest::testStopWithTimeoutIsActuallyWorking in vendor/symfony/process/Tests/SigchildDisabledProcessTest.php
SigchildEnabledProcessTest::testStopWithTimeoutIsActuallyWorking in vendor/symfony/process/Tests/SigchildEnabledProcessTest.php
SimpleProcessTest::testStopWithTimeoutIsActuallyWorking in vendor/symfony/process/Tests/SimpleProcessTest.php

File

vendor/symfony/process/Tests/AbstractProcessTest.php, line 75

Class

AbstractProcessTest
@author Robert Schönthal <seroscho@googlemail.com>

Namespace

Symfony\Component\Process\Tests

Code

public function testStopWithTimeoutIsActuallyWorking() {
  $this
    ->verifyPosixIsEnabled();

  // exec is mandatory here since we send a signal to the process
  // see https://github.com/symfony/symfony/issues/5030 about prepending
  // command with exec
  $p = $this
    ->getProcess('exec php ' . __DIR__ . '/NonStopableProcess.php 3');
  $p
    ->start();
  usleep(100000);
  $start = microtime(true);
  $p
    ->stop(1.1, SIGKILL);
  while ($p
    ->isRunning()) {
    usleep(1000);
  }
  $duration = microtime(true) - $start;
  $this
    ->assertLessThan(4, $duration);
}