8000 Add long-running failure as well · symfony/symfony@fcd5a1d · GitHub
[go: up one dir, main page]

Skip to content

Commit fcd5a1d

Browse files
committed
Add long-running failure as well
1 parent 2b6e69b commit fcd5a1d

File tree

1 file changed

+17
-3
lines changed

1 file changed

+17
-3
lines changed

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

Lines changed: 17 additions & 3 deletions
3D75
Original file line numberDiff line numberDiff line change
@@ -1553,6 +1553,18 @@ public function testMultipleCallsToProcGetStatus()
15531553
$this->assertSame(0, $process->getExitCode());
15541554
}
15551555

1556+
public function testFailingProcessWithMultipleCallsToProcGetStatus()
1557+
{
1558+
$process = $this->getProcess('exit 123');
1559+
$process->start(function () use ($process) {
1560+
$process->isRunning();
1561+
});
1562+
while ($process->isRunning()) {
1563+
usleep(1000);
1564+
}
1565+
$this->assertSame(123, $process->getExitCode());
1566+
}
1567+
15561568
/**
15571569
* @group time-sensitive
15581570
*/
@@ -1568,9 +1580,12 @@ public function testLongRunningProcessWithMultipleCallsToProcGetStatus()
15681580
$this->assertSame(0, $process->getExitCode());
15691581
}
15701582

1571-
public function testFailingProcessWithMultipleCallsToProcGetStatus()
1583+
/**
1584+
* @group time-sensitive
1585+
*/
1586+
public function testLongRunningProcessWithMultipleCallsToProcGetStatusError()
15721587
{
1573-
$process = $this->getProcess('exit 123');
1588+
$process = $this->getProcess('sleep 2; echo "failure"; exit 123');
15741589
$process->start(function () use ($process) {
15751590
$process->isRunning();
15761591
});
@@ -1580,7 +1595,6 @@ public function testFailingProcessWithMultipleCallsToProcGetStatus()
15801595
$this->assertSame(123, $process->getExitCode());
15811596
}
15821597

1583-
15841598
/**
15851599
* @group transient-on-windows
15861600
*/

0 commit comments

Comments
 (0)
0