From 88d0b4c64f5c730a9b134276b9b5001d35ded005 Mon Sep 17 00:00:00 2001 From: Alex Kavanagh Date: Thu, 9 Nov 2023 09:28:24 +0200 Subject: [PATCH] Add ObjectRetrierWraps for cinder/nova clients in cinder tests Due to how apache2 & haproxy interact on the cinder unit, this adds the ObjectRetrier to the cinder and nova clients to allow for the time delay between the apache2 service starting and the haproxy service noticing and opening the port. This allows the test_100... cinder test to function as (technically) there isn't an error. --- zaza/openstack/charm_tests/cinder/tests.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) 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):