Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Process] Incremental output missing since 3.0.2 #17937

Closed
@OndraM

Description

@OndraM

Hi, starting with Symfony 3.0.2, getIncrementalOutput() does not contain the produced incremental output in some circumstances.

I traced the cause down to PR #17423. I also discovered that if you call getOutput() before the getIncerementalOutput(), the later one works properly. I guess this is also the reason why it works in unit tests, as the getOutput is called there before to detect if some new output was already provided.

The difference is most probably in the readPipes() call inside the getOutput() method. However the fix is a bit beyond my knowledge, so at least there is testcase (part of ProcessTest::testIncrementalOutput() test)

This test passes:

// ...
foreach (array('foo', 'bar') as $s) {
    sleep(1);
    $p->getOutput();

    $this->assertSame($s, $p->getIncrementalOutput());

    flock($h, LOCK_UN);
}
// ...

This does not: (note missing getOutput() call)

// ...
foreach (array('foo', 'bar') as $s) {
    sleep(1);

    $this->assertSame($s, $p->getIncrementalOutput());

    flock($h, LOCK_UN);
}
// ...

Is there anything more I can provide? cc @romainneutron @nicolas-grekas

Thanks!

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