fixed killprocess in test script
Build on RHEL9 docker image / build (push) Successful in 3m51s
Build on RHEL8 docker image / build (push) Successful in 4m42s
Run Simulator Tests on local RHEL9 / build (push) Failing after 6m55s
Run Simulator Tests on local RHEL8 / build (push) Failing after 8m36s

This commit is contained in:
2026-08-03 12:20:14 +02:00
parent 2a94597e8c
commit 2195431c64
+11 -12
View File
@@ -91,18 +91,17 @@ def checkIfProcessRunning(processName):
def killProcess(name, fp):
pids = checkIfProcessRunning(name)
if pids:
Log(LogLevel.INFO, f"Killing '{name}' processes with PIDs: {', '.join(pids)}", fp)
for pid in pids:
try:
p = subprocess.run(['kill', pid])
if p.returncode != 0 and bool(checkIfProcessRunning(name)):
raise RuntimeException(f"Could not kill {name} with pid {pid}")
except Exception as e:
raise RuntimeException(f"Failed to kill process {name} pid:{pid}. Error: {str(e)}") from e
#else:
# Log(LogLevel.INFO, 'process not running : ' + name)
'''
Kill all processes matching name.
Does not fail if process is already gone.
'''
Log(LogLevel.INFO, f"Attempting to kill '{name}' (if running)", fp)
# pkill returns:
# 0 -> process killed
# 1 -> no process found OK
subprocess.run(['pkill', '-f', name],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL)
def cleanSharedmemory(fp):