diff --git a/zaza/openstack/charm_tests/cinder/tests.py b/zaza/openstack/charm_tests/cinder/tests.py index 421d30631..43d2fc73c 100644 --- a/zaza/openstack/charm_tests/cinder/tests.py +++ b/zaza/openstack/charm_tests/cinder/tests.py @@ -27,6 +27,7 @@ import zaza.openstack.configure.guest as guest import zaza.openstack.charm_tests.nova.utils as nova_utils import zaza.openstack.charm_tests.tempest.tests as tempest_tests +from zaza.openstack.utilities import ObjectRetrierWraps from tenacity import ( Retrying, @@ -48,10 +49,14 @@ def setUpClass(cls): cls.lead_unit = zaza.model.get_lead_unit_name( "cinder", model_name=cls.model_name) # version 3.42 is required for in-use (online) resizing lvm volumes - cls.cinder_client = openstack_utils.get_cinder_session_client( - cls.keystone_session, version=3.42) - cls.nova_client = openstack_utils.get_nova_session_client( - cls.keystone_session) + # Add retries to cinder and nova to allow for async restart issues and + # services becoming ready between configuration and individual tests. + cls.cinder_client = ObjectRetrierWraps( + openstack_utils.get_cinder_session_client( + cls.keystone_session, version=3.42)) + cls.nova_client = ObjectRetrierWraps( + openstack_utils.get_nova_session_client( + cls.keystone_session)) @classmethod def tearDown(cls): diff --git a/zaza/openstack/charm_tests/cinder_backup/tests.py b/zaza/openstack/charm_tests/cinder_backup/tests.py index 97b365808..ff36864a5 100644 --- a/zaza/openstack/charm_tests/cinder_backup/tests.py +++ b/zaza/openstack/charm_tests/cinder_backup/tests.py @@ -24,6 +24,7 @@ import zaza.openstack.charm_tests.test_utils as test_utils import zaza.openstack.utilities.ceph as ceph_utils import zaza.openstack.utilities.openstack as openstack_utils +from zaza.openstack.utilities import ObjectRetrierWraps class CinderBackupTest(test_utils.OpenStackBaseTest): @@ -35,8 +36,9 @@ class CinderBackupTest(test_utils.OpenStackBaseTest): def setUpClass(cls): """Run class setup for running Cinder Backup tests.""" super(CinderBackupTest, cls).setUpClass() - cls.cinder_client = openstack_utils.get_cinder_session_client( - cls.keystone_session) + cls.cinder_client = ObjectRetrierWraps( + openstack_utils.get_cinder_session_client( + cls.keystone_session)) @property def services(self):