diff mbox series

[1/4] toaster/test: Ensure to kill toaster process create for tests functional

Message ID 20231208015349.678997-1-alassane.yattara@savoirfairelinux.com
State New
Headers show
Series [1/4] toaster/test: Ensure to kill toaster process create for tests functional | expand

Commit Message

Alassane Yattara Dec. 8, 2023, 1:53 a.m. UTC
Toaster background task runbuilds continu running when even if tests is
done
Signed-off-by: Alassane Yattara <alassane.yattara@savoirfairelinux.com>
---
 lib/toaster/tests/functional/functional_helpers.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/lib/toaster/tests/functional/functional_helpers.py b/lib/toaster/tests/functional/functional_helpers.py
index b80d403b..c37c5f8d 100644
--- a/lib/toaster/tests/functional/functional_helpers.py
+++ b/lib/toaster/tests/functional/functional_helpers.py
@@ -33,11 +33,11 @@  class SeleniumFunctionalTestCase(SeleniumTestCaseBase):
 
         # start toaster
         cmd = "bash -c 'source toaster start'"
-        p = subprocess.Popen(
+        cls.p = subprocess.Popen(
             cmd,
             cwd=os.environ.get("BUILDDIR"),
             shell=True)
-        if p.wait() != 0:
+        if cls.p.wait() != 0:
             raise RuntimeError("Can't initialize toaster")
 
         super(SeleniumFunctionalTestCase, cls).setUpClass()
@@ -58,6 +58,7 @@  class SeleniumFunctionalTestCase(SeleniumTestCaseBase):
         with open(os.path.join(builddir, '.runbuilds.pid'), 'r') as f:
             runbuilds_pid = int(f.read())
             os.kill(runbuilds_pid, signal.SIGTERM)
+        cls.p.kill()
 
 
     def get_URL(self):