コード例 #1
0
ファイル: test_kuyruk.py プロジェクト: fatiherikli/kuyruk
 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()
コード例 #2
0
ファイル: test_kuyruk.py プロジェクト: fatiherikli/kuyruk
 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)