From 03ce7d54c384d9cfee26e43252c6e04379ec0762 Mon Sep 17 00:00:00 2001 From: Peter Sabaini Date: Tue, 10 Sep 2024 10:49:09 +0200 Subject: [PATCH] COS integration: prometheus tenacity Be more insistent in querying metrics Signed-off-by: Peter Sabaini --- zaza/openstack/charm_tests/ceph/mon/integration.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/zaza/openstack/charm_tests/ceph/mon/integration.py b/zaza/openstack/charm_tests/ceph/mon/integration.py index baf51a889..3b6fd96b3 100644 --- a/zaza/openstack/charm_tests/ceph/mon/integration.py +++ b/zaza/openstack/charm_tests/ceph/mon/integration.py @@ -61,6 +61,12 @@ def application_present(name): return False +# retry a few times until osd count is larger than 0 +@tenacity.retry( + wait=tenacity.wait_fixed(5), + retry=tenacity.retry_if_result(lambda result: result <= 0), + stop=tenacity.stop_after_delay(180), +) def get_up_osd_count(prometheus_url): """Get the number of up OSDs from prometheus.""" query = "ceph_osd_up"