@when(u'the task has started')
def when_the_task_has_started(context):
    # 120 * 0.5 = 60 seconds
    for _ in xrange(120):
        app = context.marathon_client.get_app(APP_ID)
        happy_count = app.tasks_running
        if happy_count >= 1:
            return
        time.sleep(0.5)

    raise Exception("timed out waiting for task to start")
dataset/ETHPy150Open Yelp/paasta/paasta_itests/steps/marathon_steps.py/when_the_task_has_started/original