Skip to content

STDOUT/STDERR IO streams do not exist in process isolation#1348

Closed
sun wants to merge 1 commit into
sebastianbergmann:4.1from
sun:cli-io-streams
Closed

STDOUT/STDERR IO streams do not exist in process isolation#1348
sun wants to merge 1 commit into
sebastianbergmann:4.1from
sun:cli-io-streams

Conversation

@sun

@sun sun commented Jul 24, 2014

Copy link
Copy Markdown
Contributor

The PHP CLI SAPI does not auto-register the standard IO streams when a script is piped into STDIN (which is the case in process isolation); cf.

When a test is executed without process isolation, then the STDOUT and STDERR streams are available. But if the test is executed in a separate process, then attempting to access the streams triggers a PHP Notice (undefined constant), followed by a PHP Warning (fopen).

A prominent example of affected code is e.g. vfsStream, which is an officially recommended/endorsed library for PHPUnit.

I'll add a regression test shortly.

The PHP CLI SAPI does not auto-register the standard IO streams when a script is piped into STDIN (which is the case in process isolation); cf.

- https://bugs.php.net/bug.php?id=43283
- http://php.net/manual/en/features.commandline.io-streams.php
- https://gist.github.com/sun/d02c242514c8f34bccdb
@sun

sun commented Jul 29, 2014

Copy link
Copy Markdown
Contributor Author

For consistency with recent, related PRs, I'll recreate this one against master, too.

In essence, PHPUnit 4.3 == Mature Process Isolation. (unless we're going to backport sooner)

@sun sun closed this Jul 29, 2014
@sun

sun commented Jul 29, 2014

Copy link
Copy Markdown
Contributor Author

Recreated for master, including regression test: #1366

sun added a commit to sun/drupal that referenced this pull request Aug 1, 2014
- Fix process isolation infinitely blocks on Windows.
  sebastianbergmann/phpunit#1340
- Fix standard IO streams are not defined in process isolation.
  sebastianbergmann/phpunit#1348
- Fix isolated child process leaks into parent process.
  sebastianbergmann/phpunit#1351
sun added a commit to sun/drupal that referenced this pull request Aug 1, 2014
- Fix process isolation infinitely blocks on Windows.
  sebastianbergmann/phpunit#1340
- Fix standard IO streams are not defined in process isolation.
  sebastianbergmann/phpunit#1348
- Fix isolated child process leaks into parent process.
  sebastianbergmann/phpunit#1351
sun added a commit to sun/drupal that referenced this pull request Aug 6, 2014
- Fix process isolation infinitely blocks on Windows.
  sebastianbergmann/phpunit#1340
- Fix standard IO streams are not defined in process isolation.
  sebastianbergmann/phpunit#1348
- Fix isolated child process leaks into parent process.
  sebastianbergmann/phpunit#1351
sun added a commit to sun/drupal that referenced this pull request Aug 6, 2014
- Fix process isolation infinitely blocks on Windows.
  sebastianbergmann/phpunit#1340
- Fix standard IO streams are not defined in process isolation.
  sebastianbergmann/phpunit#1348
- Fix isolated child process leaks into parent process.
  sebastianbergmann/phpunit#1351
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant