]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/test_orchestrator: Fix 'TestWriteCompletion' object has no attribute 'id' 27920/head
authorSebastian Wagner <sebastian.wagner@suse.com>
Tue, 16 Apr 2019 12:33:25 +0000 (14:33 +0200)
committerSebastian Wagner <sebastian.wagner@suse.com>
Thu, 2 May 2019 12:40:25 +0000 (14:40 +0200)
Caused by a race between `TestWriteCompletion.__init__() and
  `TestOrchestrator.serve()`

Fixes: https://tracker.ceph.com/issues/39259
Signed-off-by: Sebastian Wagner <sebastian.wagner@suse.com>
(cherry picked from commit dcffba933c0f1c488baace46d7ccc4d1b7a192e8)

src/pybind/mgr/test_orchestrator/module.py

index 131ec85bb6eac3c5937842c06a0d9a161d51b76f..be105f69dfcf161a079f5e894bb1f88c62e433d2 100644 (file)
@@ -23,6 +23,7 @@ class TestCompletionMixin(object):
         self._complete = False
 
         self.message = message
+        self.id = str(uuid.uuid4())
 
         TestCompletionMixin.all_completions.append(self)
 
@@ -52,7 +53,6 @@ class TestReadCompletion(TestCompletionMixin, orchestrator.ReadCompletion):
 class TestWriteCompletion(TestCompletionMixin, orchestrator.WriteCompletion):
     def __init__(self, cb, message):
         super(TestWriteCompletion, self).__init__(cb, message)
-        self.id = str(uuid.uuid4())
 
     @property
     def is_persistent(self):