Check aodh api after a change.

The first query against the aodh api after a restart seems to
fail. So, check the api after a restart with a tenacity wrapper.
This commit is contained in:
Liam Young
2019-09-30 12:31:50 +00:00
parent 725f2f6d3a
commit ea84bf9ed8

View File

@@ -17,6 +17,7 @@
"""Encapsulate Aodh testing."""
import logging
import tenacity
import zaza.model
import zaza.openstack.charm_tests.test_utils as test_utils
@@ -59,6 +60,12 @@ class AodhTest(test_utils.OpenStackBaseTest):
logging.info('Waiting for alarm cache to clear')
telemetry_utils.alarm_cache_wait()
@tenacity.retry(wait=tenacity.wait_exponential(multiplier=1, max=60),
reraise=True, stop=tenacity.stop_after_attempt(8))
def query_aodh_api(self):
"""Check that aodh api is responding."""
self.aodh_client.alarm.list()
@property
def services(self):
"""Return a list of the service that should be running."""
@@ -122,6 +129,7 @@ class AodhTest(test_utils.OpenStackBaseTest):
{'DEFAULT': {'debug': ['False']}},
{'DEFAULT': {'debug': ['True']}},
self.services)
self.query_aodh_api()
def test_901_pause_resume(self):
"""Run pause and resume tests.
@@ -133,3 +141,4 @@ class AodhTest(test_utils.OpenStackBaseTest):
self.services,
pgrep_full=False):
logging.info("Testing pause resume")
self.query_aodh_api()