Skip to content

Commit 783e377

Browse files
committed
[Process] Avoid failures because of slow IOs
See example of failure here https://travis-ci.org/symfony/symfony/jobs/20701462
1 parent 238565e commit 783e377

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/Symfony/Component/Process/Tests/AbstractProcessTest.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ public function testGetErrorOutput()
203203

204204
public function testGetIncrementalErrorOutput()
205205
{
206-
$p = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n = 0; while ($n < 3) { usleep(50000); file_put_contents(\'php://stderr\', \'ERROR\'); $n++; }')));
206+
$p = $this->getProcess(sprintf('php -r %s', escapeshellarg('$n = 0; while ($n < 3) { usleep(100000); file_put_contents(\'php://stderr\', \'ERROR\'); $n++; }')));
207207

208208
$p->start();
209209
while ($p->isRunning()) {
@@ -250,7 +250,7 @@ public function testTTYCommand()
250250
$this->markTestSkipped('Windows does have /dev/tty support');
251251
}
252252

253-
$process = $this->getProcess('echo "foo" >> /dev/null');
253+
$process = $this->getProcess('echo "foo" >> /dev/null && php -r "usleep(100000);"');
254254
$process->setTTY(true);
255255
$process->start();
256256
$this->assertTrue($process->isRunning());
@@ -471,7 +471,7 @@ public function testRestart()
471471
$process1->run();
472472
$process2 = $process1->restart();
473473

474-
usleep(300000); // wait for output
474+
$process2->wait(); // wait for output
475475

476476
// Ensure that both processed finished and the output is numeric
477477
$this->assertFalse($process1->isRunning());

0 commit comments

Comments
 (0)