コード例 #1
0
def test_failing_health_check_results_in_unhealthy_app():
    """Tests failed health checks of an app. The health check is meant to never pass."""

    app_def = apps.http_server()
    app_def['healthChecks'] = [common.health_check('/bad-url', 'HTTP', failures=0, timeout=3)]

    client = marathon.create_client()
    client.add_app(app_def)

    assert_that(lambda: client.get_app(app_def["id"]), eventually(
        has_values(tasksRunning=1, tasksHealthy=0, tasksUnhealthy=1), max_attempts=30))
コード例 #2
0
def test_failing_health_check_results_in_unhealthy_app():
    """Tests failed health checks of an app. The health check is meant to never pass."""

    app_def = apps.http_server()
    app_def['healthChecks'] = [
        common.health_check('/bad-url', 'HTTP', failures=0, timeout=3)
    ]

    client = marathon.create_client()
    client.add_app(app_def)

    assert_that(
        lambda: client.get_app(app_def["id"]),
        eventually(has_values(tasksRunning=1, tasksHealthy=0,
                              tasksUnhealthy=1),
                   max_attempts=30))