def test_health_check_works_with_resident_task(): """Verifies that resident tasks (common for Persistent Volumes) do not fail health checks. Marathon bug: https://jira.mesosphere.com/browse/MARATHON-7050 """ app_def = apps.resident_docker_app() client = marathon.create_client() client.add_app(app_def) shakedown.deployment_wait(timeout=timedelta(minutes=10).total_seconds()) tasks = client.get_tasks(app_def["id"]) assert len( tasks) == 1, "The number of tasks is {}, but 1 was expected".format( len(tasks)) @retrying.retry(wait_fixed=1000, stop_max_attempt_number=30, retry_on_exception=common.ignore_exception) def assert_healthy_app(app_id): app = client.get_app(app_id) assert app['tasksHealthy'] == 1, \ "The number of healthy tasks is {}, but 1 was expected".format(app['tasksHealthy']) assert_healthy_app(app_def["id"])
def test_health_check_works_with_resident_task(): """Verifies that resident tasks (common for Persistent Volumes) do not fail health checks. Marathon bug: https://jira.mesosphere.com/browse/MARATHON-7050 """ app_def = apps.resident_docker_app() app_id = app_def["id"] client = marathon.create_client() client.add_app(app_def) deployment_wait(service_id=app_id, max_attempts=500) tasks = client.get_tasks(app_def["id"]) assert len(tasks) == 1, "The number of tasks is {}, but 1 was expected".format(len(tasks)) assert_that(lambda: client.get_app(app_def['id']), eventually(has_value('tasksHealthy', 1), max_attempts=30))
def test_health_check_works_with_resident_task(): """Verifies that resident tasks (common for Persistent Volumes) do not fail health checks. Marathon bug: https://jira.mesosphere.com/browse/MARATHON-7050 """ app_def = apps.resident_docker_app() app_id = app_def["id"] client = marathon.create_client() client.add_app(app_def) common.deployment_wait(service_id=app_id, max_attempts=500) tasks = client.get_tasks(app_def["id"]) assert len(tasks) == 1, "The number of tasks is {}, but 1 was expected".format(len(tasks)) assert_that(lambda: client.get_app(app_def['id']), eventually(has_value('tasksHealthy', 1), max_attempts=30))
def test_health_check_works_with_resident_task(): """Verifies that resident tasks (common for Persistent Volumes) do not fail health checks. Marathon bug: https://jira.mesosphere.com/browse/MARATHON-7050 """ app_def = apps.resident_docker_app() client = marathon.create_client() client.add_app(app_def) shakedown.deployment_wait(timeout=timedelta(minutes=10).total_seconds()) tasks = client.get_tasks(app_def["id"]) assert len(tasks) == 1, "The number of tasks is {}, but 1 was expected".format(len(tasks)) app = client.get_app(app_def["id"]) assert app['tasksHealthy'] == 1, \ "The number of healthy tasks is {}, but 1 was expected".format(app['tasksHealthy'])