MCPcopy Create free account
hub / github.com/apache/mesos / kill

Method kill

src/python/cli_new/lib/cli/tests/base.py:291–311  ·  view source on GitHub ↗

After killing the agent, we need to make sure it has successfully unregistered from the master before proceeding.

(self, timeout=TIMEOUT)

Source from the content-addressed store, hash-verified

289
290 # pylint: disable=arguments-differ
291 def kill(self, timeout=TIMEOUT):
292 """
293 After killing the agent, we need to make sure it has
294 successfully unregistered from the master before proceeding.
295 """
296 super(Agent, self).kill()
297
298 try:
299 # pylint: disable=missing-docstring
300 def one_inactive_slave(data):
301 slaves = data["slaves"]
302 return len(slaves) == 1 and not slaves[0]["active"]
303
304 http.get_json(
305 self.flags["master"], "slaves", one_inactive_slave, timeout)
306 except Exception as exception:
307 raise CLIException("Could not get '/slaves' endpoint as"
308 " JSON with 0 agents in it: {error}"
309 .format(error=exception))
310
311 Agent.count -= 1
312
313
314class Task(Executable):

Callers 7

test_execMethod · 0.95
test_exec_exit_statusMethod · 0.95
test_exec_interactiveMethod · 0.95
test_listMethod · 0.95
test_list_allMethod · 0.95
test_launch_binariesMethod · 0.95
test_listMethod · 0.95

Calls 3

CLIExceptionClass · 0.90
get_jsonMethod · 0.80
killMethod · 0.45

Tested by 7

test_execMethod · 0.76
test_exec_exit_statusMethod · 0.76
test_exec_interactiveMethod · 0.76
test_listMethod · 0.76
test_list_allMethod · 0.76
test_launch_binariesMethod · 0.76
test_listMethod · 0.76