From 66ffef3773a679de43888a8d75a5a2f97f2e9105 Mon Sep 17 00:00:00 2001 From: techno-express Date: Mon, 24 May 2021 16:21:40 -0400 Subject: [PATCH] revert, `stop()` status should update after actual future execution --- Spawn/Future.php | 1 - tests/SpawnTest.php | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/Spawn/Future.php b/Spawn/Future.php index 672e23d..23817ce 100644 --- a/Spawn/Future.php +++ b/Spawn/Future.php @@ -487,7 +487,6 @@ public function stop(int $signal = \SIGKILL): FutureInterface $this->process->stop(0, $signal); } - $this->status = false; return $this; } diff --git a/tests/SpawnTest.php b/tests/SpawnTest.php index 1c3060e..0e5cd55 100644 --- a/tests/SpawnTest.php +++ b/tests/SpawnTest.php @@ -252,7 +252,7 @@ public function testSignal() }); $future->stop(); - $this->assertFalse($future->isRunning()); + $this->assertTrue($future->isRunning()); $future->run(); $this->assertFalse($future->isRunning()); $this->assertFalse($future->isSuccessful()); @@ -273,7 +273,7 @@ public function testSignalYield() }); $future->stop(); - $this->assertFalse($future->isRunning()); + $this->assertTrue($future->isRunning()); $yield = $future->yielding(); $this->assertTrue($yield instanceof \Generator); $this->assertNull($yield->current());