Ejemplo n.º 1
0
 def test_terminate__task_started(self):
     pool = Mock()
     tw = TaskRequest(mytask.name, uuid(), [1], {"f": "x"})
     tw.time_start = time.time()
     tw.worker_pid = 313
     tw.terminate(pool, signal="KILL")
     pool.terminate_job.assert_called_with(tw.worker_pid, "KILL")
Ejemplo n.º 2
0
 def test_terminate__task_started(self):
     pool = Mock()
     tw = TaskRequest(mytask.name, uuid(), [1], {"f": "x"})
     tw.time_start = time.time()
     tw.worker_pid = 313
     tw.terminate(pool, signal="KILL")
     pool.terminate_job.assert_called_with(tw.worker_pid, "KILL")
Ejemplo n.º 3
0
 def test_terminate__task_started(self):
     pool = Mock()
     signum = signal.SIGKILL
     tw = TaskRequest(mytask.name, uuid(), [1], {"f": "x"})
     with assert_signal_called(task_revoked, sender=tw.task, terminated=True, expired=False, signum=signum):
         tw.time_start = time.time()
         tw.worker_pid = 313
         tw.terminate(pool, signal="KILL")
         pool.terminate_job.assert_called_with(tw.worker_pid, signum)
Ejemplo n.º 4
0
 def test_terminate__task_started(self):
     pool = Mock()
     signum = signal.SIGKILL
     job = TaskRequest(self.mytask.name, uuid(), [1], {"f": "x"}, app=self.app)
     with assert_signal_called(
         task_revoked, sender=job.task, request=job, terminated=True, expired=False, signum=signum
     ):
         job.time_start = time.time()
         job.worker_pid = 313
         job.terminate(pool, signal="KILL")
         pool.terminate_job.assert_called_with(job.worker_pid, signum)
Ejemplo n.º 5
0
 def test_terminate__task_started(self):
     pool = Mock()
     signum = signal.SIGKILL
     tw = TaskRequest(mytask.name, uuid(), [1], {'f': 'x'})
     with assert_signal_called(task_revoked, sender=tw.task,
                               terminated=True,
                               expired=False,
                               signum=signum):
         tw.time_start = time.time()
         tw.worker_pid = 313
         tw.terminate(pool, signal='KILL')
         pool.terminate_job.assert_called_with(tw.worker_pid, signum)