当前位置: 首页>>代码示例>>Python>>正文


Python Retriable.alive方法代码示例

本文整理汇总了Python中apache.aurora.client.api.health_check.Retriable.alive方法的典型用法代码示例。如果您正苦于以下问题:Python Retriable.alive方法的具体用法?Python Retriable.alive怎么用?Python Retriable.alive使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在apache.aurora.client.api.health_check.Retriable的用法示例。


在下文中一共展示了Retriable.alive方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_simple_chained_health_check

# 需要导入模块: from apache.aurora.client.api.health_check import Retriable [as 别名]
# 或者: from apache.aurora.client.api.health_check.Retriable import alive [as 别名]
 def test_simple_chained_health_check(self):
   """Verify successful health check"""
   task = self.create_task(0, 'a')
   self._health_check_a.health(task).AndReturn(Retriable.alive())
   self._health_check_b.health(task).AndReturn(Retriable.alive())
   health_check = ChainedHealthCheck(self._health_check_a, self._health_check_b)
   self.replay()
   assert health_check.health(task) == Retriable.alive()
   self.verify()
开发者ID:betepahos,项目名称:incubator-aurora,代码行数:11,代码来源:test_health_check.py

示例2: test_instancewatcher_http_health_check_one_http_signaler

# 需要导入模块: from apache.aurora.client.api.health_check import Retriable [as 别名]
# 或者: from apache.aurora.client.api.health_check.Retriable import alive [as 别名]
 def test_instancewatcher_http_health_check_one_http_signaler(self):
   """Verifies that upon multiple http health checks only one HttpHealthChecker is created"""
   task = self.create_task(0, 'a')
   self.expect_http_signaler_creation()
   self.expect_health_check()
   self.expect_health_check()
   self.replay()
   assert self._smart_health_check.health(task) == Retriable.alive()
   assert self._smart_health_check.health(task) == Retriable.alive()
   self.verify()
开发者ID:betepahos,项目名称:incubator-aurora,代码行数:12,代码来源:test_health_check.py

示例3: test_unmatched_host_port

# 需要导入模块: from apache.aurora.client.api.health_check import Retriable [as 别名]
# 或者: from apache.aurora.client.api.health_check.Retriable import alive [as 别名]
 def test_unmatched_host_port(self):
   """Test if an instance with a modified a (host, port) triggers a new http health checker creation"""
   instance_id = 0
   task_a = self.create_task(instance_id, 'a')
   self.expect_http_signaler_creation()
   self.expect_health_check()
   task_b = self.create_task(instance_id, 'b', host='host-b', port=44444)
   self.expect_http_signaler_creation(host='host-b', port=44444)
   self.expect_health_check()
   self.replay()
   assert self._http_health_check.health(task_a) == Retriable.alive()
   assert self._http_health_check.health(task_b) == Retriable.alive()
   self.verify()
开发者ID:betepahos,项目名称:incubator-aurora,代码行数:15,代码来源:test_health_check.py

示例4: test_failed_secondary_health_check

# 需要导入模块: from apache.aurora.client.api.health_check import Retriable [as 别名]
# 或者: from apache.aurora.client.api.health_check.Retriable import alive [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()
开发者ID:betepahos,项目名称:incubator-aurora,代码行数:11,代码来源:test_health_check.py

示例5: test_http_health_check

# 需要导入模块: from apache.aurora.client.api.health_check import Retriable [as 别名]
# 或者: from apache.aurora.client.api.health_check.Retriable import alive [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()
开发者ID:betepahos,项目名称:incubator-aurora,代码行数:12,代码来源:test_health_check.py

示例6: setup_health_checks

# 需要导入模块: from apache.aurora.client.api.health_check import Retriable [as 别名]
# 或者: from apache.aurora.client.api.health_check.Retriable import alive [as 别名]
 def setup_health_checks(cls, mock_api):
   mock_health_check = Mock(spec=StatusHealthCheck)
   mock_health_check.health.return_value = Retriable.alive()
   return mock_health_check
开发者ID:ruo91,项目名称:incubator-aurora,代码行数:6,代码来源:test_update.py

示例7: test_health_statuses

# 需要导入模块: from apache.aurora.client.api.health_check import Retriable [as 别名]
# 或者: from apache.aurora.client.api.health_check.Retriable import alive [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)
开发者ID:BruceZu,项目名称:aurora,代码行数:8,代码来源:test_health_check.py

示例8: test_changed_task_id

# 需要导入模块: from apache.aurora.client.api.health_check import Retriable [as 别名]
# 或者: from apache.aurora.client.api.health_check.Retriable import alive [as 别名]
 def test_changed_task_id(self):
   """Verifes that an instance with a different task id causes the health check to fail"""
   task_a = self.create_task(0, 'a')
   task_b = self.create_task(0, 'b')
   assert self._status_health_check.health(task_a) == Retriable.alive()
   assert self._status_health_check.health(task_b) == NotRetriable.dead()
开发者ID:BruceZu,项目名称:aurora,代码行数:8,代码来源:test_health_check.py

示例9: test_simple_status_health_check

# 需要导入模块: from apache.aurora.client.api.health_check import Retriable [as 别名]
# 或者: from apache.aurora.client.api.health_check.Retriable import alive [as 别名]
 def test_simple_status_health_check(self):
   """Verify that running instances are reported healthy"""
   task_a = self.create_task(0, 'a')
   task_b = self.create_task(1, 'b')
   assert self._status_health_check.health(task_a) == Retriable.alive()
   assert self._status_health_check.health(task_b) == Retriable.alive()
开发者ID:BruceZu,项目名称:aurora,代码行数:8,代码来源:test_health_check.py

示例10: setup_health_checks

# 需要导入模块: from apache.aurora.client.api.health_check import Retriable [as 别名]
# 或者: from apache.aurora.client.api.health_check.Retriable import alive [as 别名]
 def setup_health_checks(cls, mock_api):
   mock_health_check = Mock(spec=InstanceWatcherHealthCheck)
   mock_health_check.health.return_value = Retriable.alive()
   return mock_health_check
开发者ID:sumanau7,项目名称:incubator-aurora,代码行数:6,代码来源:test_update.py

示例11: test_instancewatcher_health_check

# 需要导入模块: from apache.aurora.client.api.health_check import Retriable [as 别名]
# 或者: from apache.aurora.client.api.health_check.Retriable import alive [as 别名]
 def test_instancewatcher_health_check(self):
   """Verifies that if the task has no health port, only status check is performed"""
   task = self.create_task(0, 'a', port=None)
   self.replay()
   assert self._smart_health_check.health(task) == Retriable.alive()
   self.verify()
开发者ID:betepahos,项目名称:incubator-aurora,代码行数:8,代码来源:test_health_check.py


注:本文中的apache.aurora.client.api.health_check.Retriable.alive方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。