From 2968bf8e3182b0a7d345bb5c46c77c16b9258af3 Mon Sep 17 00:00:00 2001 From: Peter Sabaini Date: Fri, 1 Sep 2023 13:19:42 +0200 Subject: [PATCH] Retry ceph-proxy pool test When running the pool setup we test after the model is idle, but that is not a guarantee that all pools have finished setup, so that the test could race the pool creation. Add retry to the test to give the system another chance to complete pool creation --- zaza/openstack/charm_tests/ceph/tests.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/zaza/openstack/charm_tests/ceph/tests.py b/zaza/openstack/charm_tests/ceph/tests.py index d271841..fa8e898 100644 --- a/zaza/openstack/charm_tests/ceph/tests.py +++ b/zaza/openstack/charm_tests/ceph/tests.py @@ -1225,10 +1225,16 @@ class CephProxyTest(unittest.TestCase): zaza_model.wait_for_application_states( states=self.target_deploy_status) - pools = zaza_ceph.get_ceph_pools('ceph-mon/0') - if 'cinder-ceph' not in pools: - msg = 'cinder-ceph pool was not found upon querying ceph-mon/0' - raise zaza_exceptions.CephPoolNotFound(msg) + for attempt in tenacity.Retrying( + wait=tenacity.wait_exponential(multiplier=2, max=32), + reraise=True, stop=tenacity.stop_after_attempt(8), + ): + with attempt: + pools = zaza_ceph.get_ceph_pools('ceph-mon/0') + if 'cinder-ceph' not in pools: + msg = ('cinder-ceph pool not found querying ceph-mon/0,' + 'got: {}'.format(pools)) + raise zaza_exceptions.CephPoolNotFound(msg) # Checking for cinder-ceph specific permissions makes # the test more rugged when we add additional relations