From 203d6508dc104bcdabbc9fff90668fd90017f0b6 Mon Sep 17 00:00:00 2001 From: Bastien Nocera Date: Fri, 22 Jan 2021 11:05:42 +0100 Subject: [PATCH] tests: Fix test_input_accel() leaking a daemon test_input_accel() uses umockdev-run, and killing umockdev-run doesn't kill the child iio-sensor-proxy daemon we make it spawn, making any test running after this one fail. As the tests are run alphabetically, we were lucky that this test was the last one, but we can't rely on that. Instead, use psutil to list all the children processes and kill those before killing umockdev-run. --- .gitlab-ci.yml | 1 + tests/integration-test | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 7219600..78ea57f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,6 +13,7 @@ variables: git python3-gobject python3-dbusmock + python3-psutil umockdev build_stable: diff --git a/tests/integration-test b/tests/integration-test index b6c97ef..170df3b 100755 --- a/tests/integration-test +++ b/tests/integration-test @@ -23,6 +23,7 @@ import sys import dbus import tempfile import subprocess +import psutil import unittest import time @@ -176,6 +177,8 @@ class Tests(dbusmock.DBusTestCase): if self.daemon: try: + for child in psutil.Process(self.daemon.pid).children(recursive=True): + child.kill() self.daemon.kill() except OSError: pass