Skip to content

Commit 6172aaf

Browse files
committed
Job: checks process status first to avoid blocking on Windows (thx Claude)
(Significant acceleration under Windows!!!)
1 parent e33dc33 commit 6172aaf

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

src/Runner/Job.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
use Tester\Helpers;
1313
use function count, is_array, is_resource;
14-
use const DIRECTORY_SEPARATOR;
14+
use const DIRECTORY_SEPARATOR, PHP_OS_FAMILY;
1515

1616

1717
/**
@@ -144,13 +144,15 @@ public function isRunning(): bool
144144
return false;
145145
}
146146

147-
$this->test->stdout .= stream_get_contents($this->stdout);
148-
149147
$status = proc_get_status($this->proc);
150148
if ($status['running']) {
149+
if (PHP_OS_FAMILY !== 'Windows') {
150+
$this->test->stdout .= stream_get_contents($this->stdout);
151+
}
151152
return true;
152153
}
153154

155+
$this->test->stdout .= stream_get_contents($this->stdout);
154156
$this->duration += microtime(as_float: true);
155157

156158
fclose($this->stdout);

0 commit comments

Comments
 (0)