本文整理汇总了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