diff options
author | Zuul <zuul@review.opendev.org> | 2023-05-05 20:16:03 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2023-05-05 20:16:03 +0000 |
commit | 2c418612c4ccb4e90ca55a2426fee2a39cc46cda (patch) | |
tree | c3426eb47d66d2f574f00f8e25aedf113541e8ff | |
parent | d893368356dc9ec6a02f0d081959de3e32e79669 (diff) | |
parent | 6eb70068014c12ac887163463c84c9bf4fe398c4 (diff) | |
download | neutron-2c418612c4ccb4e90ca55a2426fee2a39cc46cda.tar.gz |
Merge "Drop retries in tests for TimeoutException"
-rw-r--r-- | neutron/tests/base.py | 27 |
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 |