]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa: add exception for test timeouts
authorPatrick Donnelly <pdonnell@redhat.com>
Thu, 6 Aug 2020 17:53:58 +0000 (10:53 -0700)
committerPatrick Donnelly <pdonnell@redhat.com>
Thu, 6 Aug 2020 18:21:54 +0000 (11:21 -0700)
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 <pdonnell@redhat.com>
qa/tasks/ceph_test_case.py

index e5c2f48b278051122381dad4d2a68c5a9fc70e50..0be1735e8ee4e1f95452fc31d9c3bb7e92f5dbe1 100644 (file)
@@ -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)