public function testHasNoAliveAfterWait() { $this->manager->fork(function () { usleep(5000); }); $this->manager->wait(); $this->assertFalse($this->manager->hasAlive()); }
public function testProcessCanTerminateOnSigTerm() { $m = new ProcessManager(); $process = $m->fork(function (Process &$p) { while (!$p->isShouldShutdown()) { $p->dispatch(); usleep(100); } }); $process->kill(); $process->wait(); $this->assertFalse($m->hasAlive()); }