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

Method launch

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

After starting the agent, we first need to make sure its reference count is increased and then check that it has successfully registered with the master before proceeding.

(self, timeout=TIMEOUT)

Source from the content-addressed store, hash-verified

264
265 # pylint: disable=arguments-differ
266 def launch(self, timeout=TIMEOUT):
267 """
268 After starting the agent, we first need to make sure its
269 reference count is increased and then check that it has
270 successfully registered with the master before proceeding.
271 """
272 super(Agent, self).launch()
273 Agent.count += 1
274
275 try:
276 # pylint: disable=missing-docstring
277 def single_slave(data):
278 return len(data["slaves"]) == 1
279
280 http.get_json(self.flags["master"], "slaves", single_slave, timeout)
281 except Exception as exception:
282 stdout = ""
283 if self.proc.poll():
284 stdout = "\n{output}".format(output=self.proc.stdout.read())
285
286 raise CLIException("Could not get '/slaves' endpoint as JSON with"
287 " only 1 agent in it: {error}{stdout}"
288 .format(error=exception, stdout=stdout))
289
290 # pylint: disable=arguments-differ
291 def kill(self, timeout=TIMEOUT):

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 5

CLIExceptionClass · 0.90
get_jsonMethod · 0.80
pollMethod · 0.80
launchMethod · 0.45
readMethod · 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