From 3408ab72d7ef0aff0d4f0d9a041e6ae260f2ad6d Mon Sep 17 00:00:00 2001 From: Jon Uriarte Date: Wed, 22 Dec 2021 17:48:54 +0000 Subject: [PATCH] Tune curl repetitions value For svc and route endpoint connectivity checks there is a repetition parameter that can be tuned to be proportional to the expected number of different endpoint responses. For each expected different backend 10 repetitions seems to be enough and it will save significant tests execution time. Change-Id: Id9e6389bfafc89a4d407952ee0625a932b51ef38 --- kuryr_tempest_plugin/tests/scenario/base.py | 11 +++++++---- kuryr_tempest_plugin/tests/scenario/consts.py | 1 + 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/kuryr_tempest_plugin/tests/scenario/base.py b/kuryr_tempest_plugin/tests/scenario/base.py index d4aa31c3..2d78e5b9 100644 --- a/kuryr_tempest_plugin/tests/scenario/base.py +++ b/kuryr_tempest_plugin/tests/scenario/base.py @@ -1046,7 +1046,8 @@ class BaseKuryrScenarioTest(manager.NetworkScenarioTest): LOG.info("Unsupported protocol %s, returning", protocol) return - self._run_and_assert(req, pred) + self._run_and_assert( + req, pred, retry_repetitions=consts.REPETITIONS_PER_BACKEND*amount) def assert_backend_amount_from_pod(self, server_ip, amount, pod, server_port=None, @@ -1137,9 +1138,10 @@ class BaseKuryrScenarioTest(manager.NetworkScenarioTest): else: LOG.info("Unsupported protocol %s, returning", protocol) return - self._run_and_assert(req, pred) + self._run_and_assert( + req, pred, retry_repetitions=consts.REPETITIONS_PER_BACKEND*amount) - def _run_and_assert(self, fn, predicate, retry_repetitions=100): + def _run_and_assert(self, fn, predicate, retry_repetitions=20): resps = [fn() for _ in range(retry_repetitions)] predicate(self, resps) @@ -1351,7 +1353,8 @@ class BaseKuryrScenarioTest(manager.NetworkScenarioTest): 'Incorrect amount of unique backends. ' 'Got {}'.format(unique_resps)) - self._run_and_assert(req, pred) + self._run_and_assert( + req, pred, retry_repetitions=consts.REPETITIONS_PER_BACKEND*amount) def create_and_ping_pod(self): name, pod = self.create_pod() diff --git a/kuryr_tempest_plugin/tests/scenario/consts.py b/kuryr_tempest_plugin/tests/scenario/consts.py index 1ba9406e..ffc444a6 100644 --- a/kuryr_tempest_plugin/tests/scenario/consts.py +++ b/kuryr_tempest_plugin/tests/scenario/consts.py @@ -20,3 +20,4 @@ POD_AFFINITY = {'requiredDuringSchedulingIgnoredDuringExecution': [ TIME_TO_APPLY_SGS = 30 POD_STATUS_RETRIES = 240 NS_TIMEOUT = 600 +REPETITIONS_PER_BACKEND = 10