Description
|
$n = @stream_select($r, $w, $e, $timeout); |
stream_select() and pipes don't play nice together on Windows. It returns immediately & causes it to get stuck inside fread().
Could use socket instead of pipe for stdout and stderr, (a la #5777), but this might break tests that use stream_select() on STDOUT or STDERR.
This was the real issue causing me trouble with #16849, as run-tests.php did not kill the test after the allotted time & the build hung forever.
(Side note: This code looks dodgy too. What if only stderr has output? it's gonna block in stdout until something happens:
|
if ($n > 0) { |
|
if ($captureStdOut) { |
|
$line = fread($pipes[1], 8192); |
|
} elseif ($captureStdErr) { |
|
$line = fread($pipes[2], 8192); |
|
} else { |
|
$line = ''; |
|
} |
|
if (strlen($line) == 0) { |
|
/* EOF */ |
|
break; |
|
} |
|
$data .= $line; |
|
} |
)
PHP Version
8.1/8.2/8.3/8.4
Operating System
Windows
Description
php-src/run-tests.php
Line 1187 in f44eaac
stream_select()and pipes don't play nice together on Windows. It returns immediately & causes it to get stuck insidefread().Could use
socketinstead ofpipeforstdoutandstderr, (a la #5777), but this might break tests that usestream_select()onSTDOUTorSTDERR.This was the real issue causing me trouble with #16849, as
run-tests.phpdid not kill the test after the allotted time & the build hung forever.(Side note: This code looks dodgy too. What if only
stderrhas output? it's gonna block instdoutuntil something happens:php-src/run-tests.php
Lines 1200 to 1213 in f44eaac
PHP Version
8.1/8.2/8.3/8.4
Operating System
Windows