diff --git a/tests/Composer/Test/Util/ProcessExecutorTest.php b/tests/Composer/Test/Util/ProcessExecutorTest.php index a05f49c72..be4af49f1 100644 --- a/tests/Composer/Test/Util/ProcessExecutorTest.php +++ b/tests/Composer/Test/Util/ProcessExecutorTest.php @@ -119,10 +119,13 @@ class ProcessExecutorTest extends TestCase { $process = new ProcessExecutor($buffer = new BufferIO('', StreamOutput::VERBOSITY_DEBUG)); $process->enableAsync(); + $start = microtime(true); /** @var Promise $promise */ - $promise = $process->executeAsync('echo foo'); + $promise = $process->executeAsync('sleep 2'); $this->assertEquals(1, $process->countActiveJobs()); $promise->cancel(); $this->assertEquals(0, $process->countActiveJobs()); + $end = microtime(true); + $this->assertTrue($end - $start < 0.5, 'Canceling took longer than it should, lasted '.($end - $start)); } }