Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PHPUnit process is blocked when there's a lot of output and a test with separate process #6003

Draft
wants to merge 2 commits into
base: 10.5
Choose a base branch
from

Conversation

staabm
Copy link
Contributor

@staabm staabm commented Oct 19, 2024

closes #5993

--SKIPIF--
<?php
for ($i = 0; $i < 390; $i++) {
\trigger_error("error {$i}");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are all the inis needed? Isn't standard long fwrite to stderr/stdout enough?

Copy link
Contributor Author

@staabm staabm Oct 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you want to assist in fixing this problem, you could try to reduce the reproducer to a very minimum.

we suppose the problem is a underlying php-src bug and having a reproducer small enough to report to the php-src project would be valuable - so at best getting something which no longer depends on PHPUnit.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the main or the child blocked?

If the main (reading) process, then output to long stdout/stderr must be enough.

If the child process, then I do not understand the problem.

Copy link
Contributor Author

@staabm staabm Oct 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think 3 processes are involved. Needs further investigation

phpunit main -> PHPT --TEST-- isolation -> process isolation (because of the attribute)


(new PHPUnit\TextUI\Application)->run($_SERVER['argv']);
--EXPECTF--
%A
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would expect the exact exception asserted here.

}
}

if (empty($pipes)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (empty($pipes)) {
if ($pipes === []) {

}
}

if (!$pipeOffset) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!$pipeOffset) {
if ($pipeOffset === 0) {

fclose($pipes[1]);
}
while (true) {
$r = $pipes;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
$r = $pipes;
$readPipes = $pipes;

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.

2 participants