From e44395ec47d5cb03871130fd09f58806b1a5161c Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Tue, 16 Apr 2019 14:33:25 +0200 Subject: [PATCH] mgr/test_orchestrator: Fix 'TestWriteCompletion' object has no attribute 'id' Caused by a race between `TestWriteCompletion.__init__() and `TestOrchestrator.serve()` Fixes: https://tracker.ceph.com/issues/39259 Signed-off-by: Sebastian Wagner (cherry picked from commit dcffba933c0f1c488baace46d7ccc4d1b7a192e8) --- src/pybind/mgr/test_orchestrator/module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pybind/mgr/test_orchestrator/module.py b/src/pybind/mgr/test_orchestrator/module.py index 131ec85bb6ea..be105f69dfcf 100644 --- a/src/pybind/mgr/test_orchestrator/module.py +++ b/src/pybind/mgr/test_orchestrator/module.py @@ -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): -- 2.47.3