#110481Console command test helper can deadlock
Description
Problem
The functional test helper
TYPO3\CMS\Core\Tests\Functional\Command\AbstractCommandTestCase::executeConsoleCommand()
runs a console command through proc_open and then reads the two output pipes
one after the other. stdout is consumed to its end first, by a plain
bc. stream_get_contents($pipes1)
and only once that call has returned and the handle has been closed is the same
done for stderr on $pipes2.
A pipe only holds a limited amount of data, 64 KiB on Linux. As soon as the
executed command writes more than that to stderr, it blocks in its own write
call and therefore never closes stdout. The test in turn blocks in
stream_get_contents() on stdout, waiting for an end of file that can no longer
arrive. Both sides wait for each other, permanently.
There is no upper limit on the runtime either. Neither stream_get_contents()
nor proc_close bounds how long it waits, and phpunit has no per test timeout,
so a command that does not return stalls the entire test run.
Effect
The run produces no further output and ends only when the CI job is killed
after 30 minutes. Thirteen such job timeouts were recorded within three days on
branch 14.3, spread over five unrelated changes and over all five runners, in
every case in a functional chunk that contains CliCommandTest. The stall always
begins directly after a failing command, and that is precisely the situation
in which a command becomes verbose on stderr.
Solution
Both pipes have to be consumed at the same time, and an upper limit on the
runtime has to be applied, so that a command which hangs fails its own test,
with the output captured so far attached, instead of stalling the whole run.
Affected branches
The helper is identical on main, 14.3 and 13.4, so all three are affected.
Reviews 3
History 14
-
Gerrit Code Review pushed patch set 1 for main to change 95322 status
NewUnder Review <span data-processor="relativetime" data-value="2026-08-13T19:07:17+00:00" > 08/13/26, 19:07 </span> -
Gerrit Code Review pushed patch set 1 for 14.3 to change 95323 <span data-processor="relativetime" data-value="2026-08-13T19:07:20+00:00" > 08/13/26, 19:07 </span>
-
Gerrit Code Review pushed patch set 1 for 13.4 to change 95324 <span data-processor="relativetime" data-value="2026-08-13T19:07:22+00:00" > 08/13/26, 19:07 </span>
-
Stefan Bürk commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-08-14T12:55:12+00:00" > 08/14/26, 12:55 </span>
Applied in changeset commit:6d943c6170857fec70030991deadd3c5e6da72f7.