本文整理汇总了Python中apache.aurora.client.api.health_check.Retriable.dead方法的典型用法代码示例。如果您正苦于以下问题:Python Retriable.dead方法的具体用法?Python Retriable.dead怎么用?Python Retriable.dead使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类apache.aurora.client.api.health_check.Retriable
的用法示例。
在下文中一共展示了Retriable.dead方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_failed_secondary_health_check
# 需要导入模块: from apache.aurora.client.api.health_check import Retriable [as 别名]
# 或者: from apache.aurora.client.api.health_check.Retriable import dead [as 别名]
def test_failed_secondary_health_check(self):
"""Verifies that a secondary health check is not invoked when a primary check fails"""
task = self.create_task(0, 'a')
self._health_check_a.health(task).AndReturn(Retriable.alive())
self._health_check_b.health(task).AndReturn(Retriable.dead())
health_check = ChainedHealthCheck(self._health_check_a, self._health_check_b)
self.replay()
assert health_check.health(task) == Retriable.dead()
self.verify()
示例2: test_instancewatcher_http_health_check
# 需要导入模块: from apache.aurora.client.api.health_check import Retriable [as 别名]
# 或者: from apache.aurora.client.api.health_check.Retriable import dead [as 别名]
def test_instancewatcher_http_health_check(self):
"""Verifies that http health check is performed if the task has a health port"""
task = self.create_task(0, 'a')
self.expect_http_signaler_creation()
self.expect_health_check(status=False)
self.replay()
assert self._smart_health_check.health(task) == Retriable.dead()
self.verify()
示例3: test_http_health_check
# 需要导入模块: from apache.aurora.client.api.health_check import Retriable [as 别名]
# 或者: from apache.aurora.client.api.health_check.Retriable import dead [as 别名]
def test_http_health_check(self):
"""Verify successful and failed http health checks for a task"""
task_a = self.create_task(0, 'a')
self.expect_http_signaler_creation()
self.expect_health_check()
self.expect_health_check(status=False)
self.replay()
assert self._http_health_check.health(task_a) == Retriable.alive()
assert self._http_health_check.health(task_a) == Retriable.dead()
self.verify()
示例4: test_health_statuses
# 需要导入模块: from apache.aurora.client.api.health_check import Retriable [as 别名]
# 或者: from apache.aurora.client.api.health_check.Retriable import dead [as 别名]
def test_health_statuses(self):
"""Verfies that the health status tuple (health, retry_status) are as expected"""
assert Retriable.alive() == (True, True)
assert Retriable.dead() == (False, True)
assert NotRetriable.alive() == (True, False)
assert NotRetriable.dead() == (False, False)
示例5: test_failed_status_health_check
# 需要导入模块: from apache.aurora.client.api.health_check import Retriable [as 别名]
# 或者: from apache.aurora.client.api.health_check.Retriable import dead [as 别名]
def test_failed_status_health_check(self):
"""Verify that the health check fails for tasks in a state other than RUNNING"""
pending_task = self.create_task(0, 'a', status=PENDING)
failed_task = self.create_task(1, 'b', status=FAILED)
assert self._status_health_check.health(pending_task) == Retriable.dead()
assert self._status_health_check.health(failed_task) == Retriable.dead()