Check task state when calculating API URL
sanmiguel opened this issue · comments
When attempting to find the scheduler's API port, we use:
client = self.ctx.marathon_client()
tasks = client.get_tasks(self.ctx.framework)
if len(tasks) != 0:
and simply assume that the first task in the list is the scheduler. However, it looks like marathon now also includes any lost tasks it knows about.
We should inspect each task object's state
field for "TASK_RUNNING"
before attempting to test the healthcheck.