From: Patrick Donnelly Date: Thu, 6 Aug 2020 17:53:58 +0000 (-0700) Subject: qa: add exception for test timeouts X-Git-Tag: v16.1.0~1494^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=dbc44e5e342605c16e1213120bec0bfec1c0091d;p=ceph.git qa: add exception for test timeouts To make this easier to catch. It is still a RuntimeError so it should not affect current tests by default. Signed-off-by: Patrick Donnelly --- diff --git a/qa/tasks/ceph_test_case.py b/qa/tasks/ceph_test_case.py index e5c2f48b278..0be1735e8ee 100644 --- a/qa/tasks/ceph_test_case.py +++ b/qa/tasks/ceph_test_case.py @@ -6,6 +6,8 @@ from teuthology.orchestra.run import CommandFailedError log = logging.getLogger(__name__) +class TestTimeoutError(RuntimeError): + pass class CephTestCase(unittest.TestCase): """ @@ -172,7 +174,7 @@ class CephTestCase(unittest.TestCase): raise RuntimeError("wait_until_equal: forbidden value {0} seen".format(val)) else: if elapsed >= timeout: - raise RuntimeError("Timed out after {0} seconds waiting for {1} (currently {2})".format( + raise TestTimeoutError("Timed out after {0} seconds waiting for {1} (currently {2})".format( elapsed, expect_val, val )) else: @@ -191,7 +193,7 @@ class CephTestCase(unittest.TestCase): return else: if elapsed >= timeout: - raise RuntimeError("Timed out after {0}s".format(elapsed)) + raise TestTimeoutError("Timed out after {0}s".format(elapsed)) else: log.debug("wait_until_true: waiting (timeout={0})...".format(timeout)) time.sleep(period)