From 5b1991bbc275b227d659b040a8fabf377d3dc041 Mon Sep 17 00:00:00 2001 From: Edward Hope-Morley Date: Tue, 30 May 2023 15:16:16 +0100 Subject: [PATCH] Retry octavia get_lb_providers The octavia tests can sometimes fail when calling get_lb_providers if they have not been setup yet. This adds a retry if keystoneauth1.exceptions.http.NotFound is raised. --- zaza/openstack/charm_tests/octavia/tests.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/zaza/openstack/charm_tests/octavia/tests.py b/zaza/openstack/charm_tests/octavia/tests.py index 925f886..8f3e8e6 100644 --- a/zaza/openstack/charm_tests/octavia/tests.py +++ b/zaza/openstack/charm_tests/octavia/tests.py @@ -316,6 +316,11 @@ class LBAASv2Test(test_utils.OpenStackBaseTest): return resp @staticmethod + @tenacity.retry( + retry=tenacity.retry_if_exception_type(keystone_exceptions.http. + NotFound), + wait=tenacity.wait_fixed(5), reraise=True, + stop=tenacity.stop_after_delay(300)) def get_lb_providers(octavia_client): """Retrieve loadbalancer providers.