]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
qa/tasks: Better handling of thrasher names and __init__ calls
authorJos Collin <jcollin@redhat.com>
Fri, 27 Sep 2019 03:39:00 +0000 (09:09 +0530)
committerJos Collin <jcollin@redhat.com>
Wed, 30 Oct 2019 04:51:25 +0000 (10:21 +0530)
Fixes: https://tracker.ceph.com/issues/42062
Fixes: https://tracker.ceph.com/issues/42478
Signed-off-by: Jos Collin <jcollin@redhat.com>
qa/tasks/ceph_manager.py
qa/tasks/daemonwatchdog.py
qa/tasks/mds_thrash.py
qa/tasks/mon_thrash.py
qa/tasks/rbd_mirror_thrash.py
qa/tasks/thrasher.py

index a635af3de5083726eb9d96ce88662dc71876e6bc..df395b5c7a063278c5f4374273aff1e9d9ecbab5 100644 (file)
@@ -106,7 +106,8 @@ class OSDThrasher(Thrasher):
     Object used to thrash Ceph
     """
     def __init__(self, manager, config, logger):
-        super(OSDThrasher, self).__init__()
+        Thrasher.__init__(self, "OSDThrasher")
+
         self.ceph_manager = manager
         self.cluster = manager.cluster
         self.ceph_manager.wait_for_clean()
index 1c54d3b622e21452531d6c22b40bc3678ac6bee0..b0212db1a00ad2b5a762f1983c85bceb072a6bc2 100644 (file)
@@ -107,7 +107,7 @@ class DaemonWatchdog(Greenlet):
 
             for thrasher in self.thrashers:
                 if thrasher.exception is not None:
-                    self.log("thrasher on fs.{name} failed".format(name=thrasher.fs.name))
+                    self.log("{name} failed".format(name=thrasher.name))
                     bark = True
 
             if bark:
index e5d86e65b5d3ee533720122caa6c0f8ab88e26e9..c3d64139ca2937b0b37ac0f288e3dd5273596aea 100644 (file)
@@ -98,7 +98,8 @@ class MDSThrasher(Greenlet, Thrasher):
     """
 
     def __init__(self, ctx, manager, config, fs, max_mds):
-        super(MDSThrasher, self).__init__()
+        Greenlet.__init__(self)
+        Thrasher.__init__(self, "MDSThrasher")
 
         self.config = config
         self.ctx = ctx
@@ -416,6 +417,7 @@ def task(ctx, config):
 
     for fs in status.get_filesystems():
         thrasher = MDSThrasher(ctx, manager, config, Filesystem(ctx, fs['id']), fs['mdsmap']['max_mds'])
+        thrasher.name = thrasher.name + " on fs." + thrasher.fs.name
         thrasher.start()
         ctx.ceph[config['cluster']].thrashers.append(thrasher)
 
index ed0940c4ebf2e2dff7a8972c5c6ad5db5bc3ff8e..191b2809d8d281816d76cd0460c16f661b4925c7 100644 (file)
@@ -86,7 +86,8 @@ class MonitorThrasher(Thrasher):
             - mon/workloadgen.sh
     """
     def __init__(self, ctx, manager, config, logger):
-        super(MonitorThrasher, self).__init__()
+        Thrasher.__init__(self, "MonitorThrasher")
+
         self.ctx = ctx
         self.manager = manager
         self.manager.wait_for_clean()
index fceb5cfeb9863670b0d53a7be86c38706c618056..fa1e043ed317c1938fa391bcb98c084e9daa62be 100644 (file)
@@ -64,7 +64,8 @@ class RBDMirrorThrasher(Greenlet, Thrasher):
     """
 
     def __init__(self, ctx, config, cluster, daemons):
-        super(RBDMirrorThrasher, self).__init__()
+        Greenlet.__init__(self)
+        Thrasher.__init__(self, "RBDMirrorThrasher")
 
         self.ctx = ctx
         self.config = config
index fc783eaa6973a3993a5173ef153418aa10096151..f974745cbd0cbcd021e9c398da23c9efde02a205 100644 (file)
@@ -3,9 +3,10 @@ Thrasher base class
 """
 class Thrasher(object):
 
-    def __init__(self):
+    def __init__(self, n):
         super(Thrasher, self).__init__()
-        self.exception = None
+        self._exception = None
+        self._name = n
 
     @property
     def exception(self):
@@ -14,3 +15,11 @@ class Thrasher(object):
     @exception.setter
     def exception(self, e):
         self._exception = e
+
+    @property
+    def name(self):
+        return self._name
+
+    @name.setter
+    def name(self, n):
+        self._name = n