From 70ebdd632ccc96a24b306846930a6a2622dc50e4 Mon Sep 17 00:00:00 2001 From: Jakub Smolar Date: Thu, 21 Dec 2023 16:38:39 +0100 Subject: [PATCH] Added backof to dns health probe --- testsuite/policy/dns_policy.py | 3 +++ testsuite/tests/mgc/dnspolicy/health_check/conftest.py | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/testsuite/policy/dns_policy.py b/testsuite/policy/dns_policy.py index 4d277450..79237f8a 100644 --- a/testsuite/policy/dns_policy.py +++ b/testsuite/policy/dns_policy.py @@ -2,7 +2,9 @@ from dataclasses import dataclass from typing import Optional, Literal +import backoff import openshift as oc +from openshift import OpenShiftPythonException from testsuite.utils import asdict from testsuite.gateway import Referencable @@ -57,6 +59,7 @@ def set_health_check(self, health_check: HealthCheck): """Sets health check for DNSPolicy""" self.model["spec"]["healthCheck"] = asdict(health_check) + @backoff.on_exception(backoff.fibo, OpenShiftPythonException, max_tries=13, jitter=None) def get_dns_health_probe(self) -> oc.APIObject: """Returns DNSHealthCheckProbe object for the created DNSPolicy""" with self.context: diff --git a/testsuite/tests/mgc/dnspolicy/health_check/conftest.py b/testsuite/tests/mgc/dnspolicy/health_check/conftest.py index 2135a2c6..5a227b22 100644 --- a/testsuite/tests/mgc/dnspolicy/health_check/conftest.py +++ b/testsuite/tests/mgc/dnspolicy/health_check/conftest.py @@ -1,5 +1,4 @@ """Conftest for DNSPolicy health checks""" -import time import pytest from testsuite.gateway import Hostname @@ -51,5 +50,4 @@ def dns_policy(dns_policy, health_check): @pytest.fixture(scope="module") def dns_health_probe(dns_policy, route): # pylint: disable=unused-argument """Wait for health check to start monitoring endpoint and return according DNSHealthCheckProbe object""" - time.sleep(10) return dns_policy.get_dns_health_probe()