Skip to content

Commit

Permalink
revert, stop() status should update after actual future execution
Browse files Browse the repository at this point in the history
  • Loading branch information
TheTechsTech committed May 24, 2021
1 parent f953305 commit 66ffef3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion Spawn/Future.php
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,6 @@ public function stop(int $signal = \SIGKILL): FutureInterface
$this->process->stop(0, $signal);
}

$this->status = false;
return $this;
}

Expand Down
4 changes: 2 additions & 2 deletions tests/SpawnTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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());
Expand Down

0 comments on commit 66ffef3

Please sign in to comment.