def test_worker_sigquit(self): """Ack current message and exit""" tasks.loop_forever() with run_kuyruk(terminate=False) as worker: worker.expect('looping forever') pid = get_pid('kuyruk: worker') os.kill(pid, signal.SIGQUIT) worker.expect('Acking current task') worker.expect('Exiting') worker.expect_exit(0) assert is_empty('kuyruk'), worker.get_output()
def test_cold_shutdown(self): """If the worker is stuck on the task it can be stopped by invoking cold shutdown""" tasks.loop_forever() with run_kuyruk(process='master', terminate=False) as master: master.expect('looping forever') master.send_signal(signal.SIGINT) master.expect('Warm shutdown') master.expect('Handled SIGINT') master.send_signal(signal.SIGINT) master.expect('Cold shutdown') master.expect_exit(0) wait_until(not_running, timeout=TIMEOUT)