fix: sync wrapper runner with paratest

This commit is contained in:
Nuno Maduro
2023-09-19 11:27:09 +01:00
parent 876629b744
commit 6f54462070

View File

@ -254,11 +254,11 @@ final class WrapperRunner implements RunnerInterface
private function destroyWorker(int $token): void private function destroyWorker(int $token): void
{ {
// Mutation Testing tells us that the following `unset()` already destroys
// the `WrapperWorker`, which destroys the Symfony's `Process`, which
// automatically calls `Process::stop` within `Process::__destruct()`.
// But we prefer to have an explicit stops.
$this->workers[$token]->stop(); $this->workers[$token]->stop();
// We need to wait for ApplicationForWrapperWorker::end to end
while ($this->workers[$token]->isRunning()) {
usleep(self::CYCLE_SLEEP);
}
unset($this->workers[$token]); unset($this->workers[$token]);
} }