diff --git a/tests/scripts/test_simulators.py b/tests/scripts/test_simulators.py index 46510fc6a..370ecc1b9 100644 --- a/tests/scripts/test_simulators.py +++ b/tests/scripts/test_simulators.py @@ -35,8 +35,8 @@ def killProcess(name): try: cmd = f"kill -9 {pid}" p = subprocess.run(['kill', '-9', pid]) - if p.returncode != 0: - raise RuntimeException("'kill -9' failed for " + name) + if p.returncode != 0 and bool(checkIfProcessRunning(name)): + raise RuntimeException(f"'kill -9' failed for {name} with pid {pid}") except Exception as e: Log(Fore.RED, f"Failed to kill process {name} pid:{pid}. Exception occured: [code:{e}, msg:{e.stderr}]") raise