Phpunit 单元测试Symfony 4.2进程运行无限循环(而不是超时),但单元测试工作正常吗

Phpunit 单元测试Symfony 4.2进程运行无限循环(而不是超时),但单元测试工作正常吗,phpunit,symfony4,php-7.2,symfony-process,Phpunit,Symfony4,Php 7.2,Symfony Process,假设我有以下Symfony 4命令: class Command1 extends Command { protected static $defaultName = 'app:command1'; protected function execute(InputInterface $input, OutputInterface $output){ $process = new Process('bin/console list', getcwd());

假设我有以下Symfony 4命令:

class Command1  extends Command {
    protected static $defaultName = 'app:command1';

    protected function execute(InputInterface $input, OutputInterface $output){
        $process = new Process('bin/console list', getcwd());
        $process->start(); // or even $process->run() does not matter if its async or not
        // ... where we handle if its finished, etc...
    }
}
如果我只是调用
bin/console app:command1
,它将返回预期的命令列表。基本上和我预期的一样

但是如果我有一个phpunit测试,它使用
Symfony\Component\Console\Application::run()
来启动这个命令,那么我会在

do {
    $this->checkTimeout();
    $running = '\\' === \DIRECTORY_SEPARATOR ? $this->isRunning() : $this->processPipes->areOpen();
    $this->readPipes($running, '\\' !== \DIRECTORY_SEPARATOR || !$running);
} while ($running);
其中,
$this->processPipes->areOpen()
将始终打开

在我看来,如果我通过phpunit在进程中使用任何Symfony控制台命令,总会有两条管道像这样打开:

1 = {resource} resource id='x' type='stream'
2 = {resource} resource id='z' type='stream'
但我不知道这些到底是什么。我在htop中还看到start()的
proc\u open
实际上启动了一个新进程,但它只是挂起(完全不做任何事情,甚至无法调试),直到超时。错误日志中没有任何内容(超时除外)