本文整理匯總了Python中ion.agents.cei.execution_engine_agent.ExecutionEngineAgentClient.cleanup_process方法的典型用法代碼示例。如果您正苦於以下問題:Python ExecutionEngineAgentClient.cleanup_process方法的具體用法?Python ExecutionEngineAgentClient.cleanup_process怎麽用?Python ExecutionEngineAgentClient.cleanup_process使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ion.agents.cei.execution_engine_agent.ExecutionEngineAgentClient
的用法示例。
在下文中一共展示了ExecutionEngineAgentClient.cleanup_process方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: ExecutionEngineAgentPyonIntTest
# 需要導入模塊: from ion.agents.cei.execution_engine_agent import ExecutionEngineAgentClient [as 別名]
# 或者: from ion.agents.cei.execution_engine_agent.ExecutionEngineAgentClient import cleanup_process [as 別名]
#.........這裏部分代碼省略.........
log.warn("Timeout calling EEAgent dump_state. retrying.")
continue
proc = get_proc_for_upid(state, upid)
last_state = proc.get("state")
if last_state == desired_state:
return
gevent.sleep(1)
attempts += 1
assert False, "Process %s took too long to get to %s, had %s" % (upid, desired_state, last_state)
@needs_eeagent
def test_basics(self):
u_pid = "test0"
round = 0
run_type = "pyon"
proc_name = "test_x"
module = "ion.agents.cei.test.test_eeagent"
cls = "TestProcess"
parameters = {"name": proc_name, "module": module, "cls": cls}
self.eea_client.launch_process(u_pid, round, run_type, parameters)
self.wait_for_state(u_pid, [500, "RUNNING"])
state = self.eea_client.dump_state().result
assert len(state["processes"]) == 1
self.eea_client.terminate_process(u_pid, round)
self.wait_for_state(u_pid, [700, "TERMINATED"])
state = self.eea_client.dump_state().result
assert len(state["processes"]) == 1
self.eea_client.cleanup_process(u_pid, round)
state = self.eea_client.dump_state().result
assert len(state["processes"]) == 0
@needs_eeagent
def test_restart(self):
u_pid = "test0"
round = 0
run_type = "pyon"
proc_name = "test_x"
module = "ion.agents.cei.test.test_eeagent"
cls = "TestProcess"
parameters = {"name": proc_name, "module": module, "cls": cls}
self.eea_client.launch_process(u_pid, round, run_type, parameters)
self.wait_for_state(u_pid, [500, "RUNNING"])
state = self.eea_client.dump_state().result
assert len(state["processes"]) == 1
# Start again with incremented round. eeagent should restart the process
round += 1
self.eea_client.launch_process(u_pid, round, run_type, parameters)
self.wait_for_state(u_pid, [500, "RUNNING"])
state = self.eea_client.dump_state().result
ee_round = state["processes"][0]["round"]
assert round == int(ee_round)
# TODO: this test is disabled, as the restart op is disabled
# Run restart with incremented round. eeagent should restart the process
# round += 1