File tree 1 file changed +17
-3
lines changed
src/Symfony/Component/Process/Tests 1 file changed +17
-3
lines changed Original file line number Diff line number Diff line change @@ -1553,6 +1553,18 @@ public function testMultipleCallsToProcGetStatus()
1553
1553
$ this ->assertSame (0 , $ process ->getExitCode ());
1554
1554
}
1555
1555
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
+
1556
1568
/**
1557
1569
* @group time-sensitive
1558
1570
*/
@@ -1568,9 +1580,12 @@ public function testLongRunningProcessWithMultipleCallsToProcGetStatus()
1568
1580
$ this ->assertSame (0 , $ process ->getExitCode ());
1569
1581
}
1570
1582
1571
- public function testFailingProcessWithMultipleCallsToProcGetStatus ()
1583
+ /**
1584
+ * @group time-sensitive
1585
+ */
1586
+ public function testLongRunningProcessWithMultipleCallsToProcGetStatusError ()
1572
1587
{
1573
- $ process = $ this ->getProcess ('exit 123 ' );
1588
+ $ process = $ this ->getProcess ('sleep 2; echo "failure"; exit 123 ' );
1574
1589
$ process ->start (function () use ($ process ) {
1575
1590
$ process ->isRunning ();
1576
1591
});
@@ -1580,7 +1595,6 @@ public function testFailingProcessWithMultipleCallsToProcGetStatus()
1580
1595
$ this ->assertSame (123 , $ process ->getExitCode ());
1581
1596
}
1582
1597
1583
-
1584
1598
/**
1585
1599
* @group transient-on-windows
3D75
1586
1600
*/
You can’t perform that action at this time.
0 commit comments