diff --git a/Spawn/Future.php b/Spawn/Future.php index cf17fe3..672e23d 100644 --- a/Spawn/Future.php +++ b/Spawn/Future.php @@ -166,7 +166,6 @@ public function close() $this->processOutput = null; $this->processError = null; $this->process = null; - $this->status = null; $this->task = null; $this->signal = null; unset($this->messages); @@ -488,6 +487,7 @@ 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 0e5cd55..1c3060e 100644 --- a/tests/SpawnTest.php +++ b/tests/SpawnTest.php @@ -252,7 +252,7 @@ public function testSignal() }); $future->stop(); - $this->assertTrue($future->isRunning()); + $this->assertFalse($future->isRunning()); $future->run(); $this->assertFalse($future->isRunning()); $this->assertFalse($future->isSuccessful()); @@ -273,7 +273,7 @@ public function testSignalYield() }); $future->stop(); - $this->assertTrue($future->isRunning()); + $this->assertFalse($future->isRunning()); $yield = $future->yielding(); $this->assertTrue($yield instanceof \Generator); $this->assertNull($yield->current());