summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryatinkarel <ykarel@redhat.com>2023-05-05 12:08:16 +0530
committeryatinkarel <ykarel@redhat.com>2023-05-05 14:17:33 +0530
commit6eb70068014c12ac887163463c84c9bf4fe398c4 (patch)
tree0a48b97ca39c9440198764a8445e5132072dea70
parentfd17662611329630382c453b845cf9974544f3b1 (diff)
downloadneutron-6eb70068014c12ac887163463c84c9bf4fe398c4.tar.gz
Drop retries in tests for TimeoutException
It was originally added due to [1] which is already reverted[2] as pyroute2>=0.5.5 included the fix, so the retries hack can also be removed. [1] https://review.opendev.org/c/openstack/neutron/+/631275 [2] https://review.opendev.org/c/openstack/neutron/+/698854 Related-Bug: #1811515 Change-Id: I6d7b1c82c19d93c4a24f253bdc4c5b6164cfbaaa
-rw-r--r--neutron/tests/base.py27
1 files changed, 4 insertions, 23 deletions
diff --git a/neutron/tests/base.py b/neutron/tests/base.py
index 0cf7ca4402..53bd380fc2 100644
--- a/neutron/tests/base.py
+++ b/neutron/tests/base.py
@@ -46,7 +46,6 @@ from oslotest import base
from osprofiler import profiler
from sqlalchemy import exc as sqlalchemy_exc
import testtools
-from testtools import content
from neutron._i18n import _
from neutron.agent.linux import external_process
@@ -68,8 +67,6 @@ ETCDIR = os.path.join(ROOTDIR, 'etc')
SUDO_CMD = 'sudo -n'
-TESTCASE_RETRIES = 3
-
def etcdir(*p):
return os.path.join(ETCDIR, *p)
@@ -177,26 +174,10 @@ class AttributeDict(dict):
def _catch_timeout(f):
@functools.wraps(f)
def func(self, *args, **kwargs):
- for idx in range(1, TESTCASE_RETRIES + 1):
- try:
- return f(self, *args, **kwargs)
- except eventlet.Timeout as e:
- self.fail('Execution of this test timed out: %s' % e)
- # NOTE(ralonsoh): exception catch added due to the constant
- # occurrences of this exception during FT and UT execution.
- # This is due to [1]. Once the sync decorators are removed or the
- # privsep ones are decorated by those ones (swap decorator
- # declarations) this catch can be remove.
- # [1] https://review.opendev.org/#/c/631275/
- except fixtures.TimeoutException:
- if idx < TESTCASE_RETRIES:
- msg = ('"fixtures.TimeoutException" during test case '
- 'execution no %s; test case re-executed' % idx)
- self.addDetail('DietTestCase',
- content.text_content(msg))
- self._set_timeout()
- else:
- self.fail('Execution of this test timed out')
+ try:
+ return f(self, *args, **kwargs)
+ except eventlet.Timeout as e:
+ self.fail('Execution of this test timed out: %s' % e)
return func