From fc9fd8a7ada48a1c2bc762b18814c1008b9f1df4 Mon Sep 17 00:00:00 2001 From: Gorka Eguileor Date: Fri, 19 Aug 2022 11:23:37 +0200 Subject: Tests: Fix service stopping on cleanup Our services don't have a 'kill' method, they have a 'stop' method, so it doesn't make any sense to call the 'kill' method on them during test cleanup. This patch changes the 'kill' call with the right 'stop' call. Change-Id: Ib1bae260b8b5289e9a6c80baf2de9e908f977d09 (cherry picked from commit 1ef8e3ddc270ce87da4bac507b8760e19f4d43f2) --- cinder/tests/unit/test.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cinder/tests/unit/test.py b/cinder/tests/unit/test.py index 21f2d1eb8..df9a3eebf 100644 --- a/cinder/tests/unit/test.py +++ b/cinder/tests/unit/test.py @@ -333,10 +333,10 @@ class TestCase(testtools.TestCase): def _common_cleanup(self): """Runs after each test method to tear down test environment.""" - # Kill any services + # Stop any services (this stops RPC handlers) for x in self._services: try: - x.kill() + x.stop() except Exception: pass -- cgit v1.2.1