]> git.ipfire.org Git - thirdparty/libcgroup.git/commitdiff
ftests/run.py: terminate processes that exceed timeout
authorKamalesh Babulal <kamalesh.babulal@oracle.com>
Wed, 4 Jun 2025 14:58:31 +0000 (20:28 +0530)
committerTom Hromatka <tom.hromatka@oracle.com>
Mon, 16 Jun 2025 14:14:46 +0000 (08:14 -0600)
Some commands, like 'cgrulesengd' in non-daemon mode, continue running
until explicitly terminated. Currently, we catch exceptions for timeouts
but do not terminate the lingering process. This patch ensures that such
processes are properly killed after the timeout.

Signed-off-by: Kamalesh Babulal <kamalesh.babulal@oracle.com>
Signed-off-by: Tom Hromatka <tom.hromatka@oracle.com>
(cherry picked from commit edd5497c2027818aebba2c5eb28c9b27eb0d3efa)

tests/ftests/run.py

index deddde17b5ac2d120c78da6a32ba2c7a95b85564..e063a4cd828df9c3d1f4960f8d352a277be4b0ee 100644 (file)
@@ -49,6 +49,9 @@ class Run(object):
                     ret = -1
                 else:
                     ret = 0
+
+                # kill the process, that has exceeded the timeout
+                subproc.kill()
         else:
             out, err = subproc.communicate()
             ret = subproc.returncode