From 6f544620706d1d77f8068d920687d1653e25d24a Mon Sep 17 00:00:00 2001 From: Nuno Maduro Date: Tue, 19 Sep 2023 11:27:09 +0100 Subject: [PATCH] fix: sync wrapper runner with paratest --- src/Plugins/Parallel/Paratest/WrapperRunner.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Plugins/Parallel/Paratest/WrapperRunner.php b/src/Plugins/Parallel/Paratest/WrapperRunner.php index 8b75bc4c..0c955574 100644 --- a/src/Plugins/Parallel/Paratest/WrapperRunner.php +++ b/src/Plugins/Parallel/Paratest/WrapperRunner.php @@ -254,11 +254,11 @@ private function startWorker(int $token): WrapperWorker 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(); + // We need to wait for ApplicationForWrapperWorker::end to end + while ($this->workers[$token]->isRunning()) { + usleep(self::CYCLE_SLEEP); + } unset($this->workers[$token]); }