Skip to content

[Console] Testing src/Symfony/Component/Console fails during a full php ./phpuinit symfony test #61434

@glouton

Description

@glouton

Symfony version(s) affected

6.4 and 7.3

Description

As I was digging into #61415 I've noticed that the PHPUnit test of src/Symfony/Component/Console is failing when run during a full php ./phpunit symfony.

PHPUnit 9.6.24 by Sebastian Bergmann and contributors.

Testing /home/glouton/Projets/live/symfony-contributing/symfony/src/Symfony/Component/Console
.............................................................   61 / 1281 (  4%)
........................................................E....  122 / 1281 (  9%)
.............................................................  183 / 1281 ( 14%)
.............................................................  244 / 1281 ( 19%)
.................................F...........................  305 / 1281 ( 23%)
.............................................................  366 / 1281 ( 28%)
.............................................................  427 / 1281 ( 33%)
.............................................................  488 / 1281 ( 38%)
.............................................................  549 / 1281 ( 42%)
.............................................................  610 / 1281 ( 47%)
.............................................................  671 / 1281 ( 52%)
.............................................................  732 / 1281 ( 57%)
.............................................................  793 / 1281 ( 61%)
.............................................................  854 / 1281 ( 66%)
.............................................................  915 / 1281 ( 71%)
.............................................................  976 / 1281 ( 76%)
............................................................. 1037 / 1281 ( 80%)
............................................................. 1098 / 1281 ( 85%)
............................................................. 1159 / 1281 ( 90%)
............................................................. 1220 / 1281 ( 95%)
...................S......................................... 1281 / 1281 (100%)


Time: 00:07.627, Memory: 16.00 MB

There was 1 error:

1) Symfony\Component\Console\Tests\ApplicationTest::testSignalableRestoresStty
Symfony\Component\Process\Exception\RuntimeException: TTY mode requires /dev/tty to be read/writable.

/home/glouton/Projets/live/symfony-contributing/symfony/src/Symfony/Component/Process/Process.php:1021
/home/glouton/Projets/live/symfony-contributing/symfony/src/Symfony/Component/Console/Tests/ApplicationTest.php:2213

--

There was 1 failure:

1) Symfony\Component\Console\Tests\CursorTest::testGetCurrentPosition
Failed asserting that false matches expected true.

/home/glouton/Projets/live/symfony-contributing/symfony/src/Symfony/Component/Console/Tests/CursorTest.php:187

ERRORS!
Tests: 1281, Assertions: 2251, Errors: 1, Failures: 1, Skipped: 1.

Legacy deprecation notices (2)
KO src/Symfony/Component/Console

But it passes when run on it's own with php ./phpunit src/Symfony/Component/Console.

$ php ./phpunit src/Symfony/Component/Console
PHPUnit 9.6.24 by Sebastian Bergmann and contributors.

Testing /home/glouton/Projets/live/symfony-contributing/symfony/src/Symfony/Component/Console
.............................................................   61 / 1379 (  4%)
........................................................😊
  [0] y
 > .....  122 / 1379 (  8%)
.............................................................  183 / 1379 ( 13%)
.............................................................  244 / 1379 ( 17%)
.............................................................  305 / 1379 ( 22%)
.............................................................  366 / 1379 ( 26%)
.............................................................  427 / 1379 ( 30%)
.............................................................  488 / 1379 ( 35%)
.............................................................  549 / 1379 ( 39%)
.............................................................  610 / 1379 ( 44%)
.............................................................  671 / 1379 ( 48%)
.............................................................  732 / 1379 ( 53%)
.............................................................  793 / 1379 ( 57%)
.............................................................  854 / 1379 ( 61%)
.............................................................  915 / 1379 ( 66%)
.............................................................  976 / 1379 ( 70%)
............................................................. 1037 / 1379 ( 75%)
............................................................. 1098 / 1379 ( 79%)
............................................................. 1159 / 1379 ( 84%)
............................................................. 1220 / 1379 ( 88%)
............................................................. 1281 / 1379 ( 92%)
.......................................................S..... 1342 / 1379 ( 97%)
.....................................                         1379 / 1379 (100%)

Time: 00:08.609, Memory: 18.00 MB

OK, but incomplete, skipped, or risky tests!
Tests: 1379, Assertions: 2488, Skipped: 1.

How to reproduce

Run full symfony tests with php ./phpunit symfony.

Possible Solution

Don't have any solution but a possible lead.
I've crawled into the code up to symfony/vendor/symfony/phpunit-bridge/bin/simple-phpunit.php trying to find a significant difference between running tests for a single component and running tests for all of them.

Basically, when we run all of them it's a loop and the output of the shell command is redirected to files.
Here's a difference!
So I tried to run php ./phpunit src/Symfony/Component/Console > ~/tmp/symfony-tests/Console-stdout 2> ~/tmp/symfony-tests/Console-stderr.
And, yes, the Console-stdout does show the same error and failure.

$ cat ~/tmp/symfony-tests/Console-stdout 
PHPUnit 9.6.24 by Sebastian Bergmann and contributors.

Testing /home/glouton/Projets/live/symfony-contributing/symfony/src/Symfony/Component/Console
.............................................................   61 / 1379 (  4%)
........................................................E....  122 / 1379 (  8%)
.............................................................  183 / 1379 ( 13%)
.............................................................  244 / 1379 ( 17%)
.............................................................  305 / 1379 ( 22%)
...........F.................................................  366 / 1379 ( 26%)
.............................................................  427 / 1379 ( 30%)
.............................................................  488 / 1379 ( 35%)
.............................................................  549 / 1379 ( 39%)
.............................................................  610 / 1379 ( 44%)
.............................................................  671 / 1379 ( 48%)
.............................................................  732 / 1379 ( 53%)
.............................................................  793 / 1379 ( 57%)
.............................................................  854 / 1379 ( 61%)
.............................................................  915 / 1379 ( 66%)
.............................................................  976 / 1379 ( 70%)
............................................................. 1037 / 1379 ( 75%)
............................................................. 1098 / 1379 ( 79%)
............................................................. 1159 / 1379 ( 84%)
............................................................. 1220 / 1379 ( 88%)
............................................................. 1281 / 1379 ( 92%)
.......................................................S..... 1342 / 1379 ( 97%)
.....................................                         1379 / 1379 (100%)

Time: 00:08.849, Memory: 18.00 MB

There was 1 error:

1) Symfony\Component\Console\Tests\ApplicationTest::testSignalableRestoresStty
Symfony\Component\Process\Exception\RuntimeException: TTY mode requires /dev/tty to be read/writable.

/home/glouton/Projets/live/symfony-contributing/symfony/src/Symfony/Component/Process/Process.php:1048
/home/glouton/Projets/live/symfony-contributing/symfony/src/Symfony/Component/Console/Tests/ApplicationTest.php:2241

--

There was 1 failure:

1) Symfony\Component\Console\Tests\CursorTest::testGetCurrentPosition
Failed asserting that false matches expected true.

/home/glouton/Projets/live/symfony-contributing/symfony/src/Symfony/Component/Console/Tests/CursorTest.php:187

ERRORS!
Tests: 1379, Assertions: 2485, Errors: 1, Failures: 1, Skipped: 1.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions