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

Method launch

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

After starting the task, we need to make sure its container has actually been added to the agent before proceeding.

(self, timeout=TIMEOUT)

Source from the content-addressed store, hash-verified

377
378 # pylint: disable=arguments-differ
379 def launch(self, timeout=TIMEOUT):
380 """
381 After starting the task, we need to make sure its container
382 has actually been added to the agent before proceeding.
383 """
384 super(Task, self).launch()
385 Task.count += 1
386
387 try:
388 # pylint: disable=missing-docstring
389 def container_exists(data):
390 return any(container["executor_id"] == self.flags["name"]
391 for container in data)
392
393 self.__wait_for_containers(container_exists, timeout)
394 except Exception as exception:
395 stdout = ""
396 if self.proc.poll():
397 stdout = "\n{output}".format(output=self.proc.stdout.read())
398 self.proc = None
399
400 raise CLIException("Waiting for container '{name}'"
401 " failed: {error}{stdout}"
402 .format(name=self.flags["name"],
403 error=exception,
404 stdout=stdout))
405
406 # pylint: disable=arguments-differ
407 def kill(self, timeout=TIMEOUT):

Callers 8

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
launchMethod · 0.45
launchMethod · 0.45

Calls 4

__wait_for_containersMethod · 0.95
CLIExceptionClass · 0.90
pollMethod · 0.80
readMethod · 0.45

Tested by 6

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