-
Notifications
You must be signed in to change notification settings - Fork 8k
Closed
Description
Description
Line 1187 in f44eaac
| $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:
Lines 1200 to 1213 in f44eaac
| 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
cmb69