From: Jos Collin Date: Tue, 16 Jul 2019 23:11:49 +0000 (+0530) Subject: qa/tasks: add exception in do_thrash() X-Git-Tag: v15.1.0~2169^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=614eef907a0a445941ef50f5dd3aa9247d90be46;p=ceph-ci.git qa/tasks: add exception in do_thrash() Fixes the bug during DaemonWatchdog testing: Traceback (most recent call last): File "/home/teuthworker/src/github.com_ceph_ceph-c_wip-daemonwatchdog-testing13/qa/tasks/daemonwatchdog.py", line 38, in _run self.watch() File "/home/teuthworker/src/github.com_ceph_ceph-c_wip-daemonwatchdog-testing13/qa/tasks/daemonwatchdog.py", line 112, in watch if thrasher.e is not None: AttributeError: MonitorThrasher instance has no attribute 'e' Signed-off-by: Jos Collin --- diff --git a/qa/tasks/mon_thrash.py b/qa/tasks/mon_thrash.py index d264e8bcf8a..dc1866a2c6a 100644 --- a/qa/tasks/mon_thrash.py +++ b/qa/tasks/mon_thrash.py @@ -89,6 +89,7 @@ class MonitorThrasher: self.manager = manager self.manager.wait_for_clean() + self.e = None self.stopping = False self.logger = logger self.config = config @@ -220,6 +221,19 @@ class MonitorThrasher: return m def do_thrash(self): + """ + _do_thrash() wrapper. + """ + try: + self._do_thrash() + except Exception as e: + # See _run exception comment for MDSThrasher + self.e = e + self.logger.exception("exception:") + # Allow successful completion so gevent doesn't see an exception. + # The DaemonWatchdog will observe the error and tear down the test. + + def _do_thrash(self): """ Continuously loop and thrash the monitors. """