diff --git a/benchkit/communication/__init__.py b/benchkit/communication/__init__.py index 0965078..7cc44d9 100644 --- a/benchkit/communication/__init__.py +++ b/benchkit/communication/__init__.py @@ -789,7 +789,20 @@ def get_process_nb_threads(self, process_handle: subprocess.Popen) -> int: raise NotImplementedError("TODO") def get_process_status(self, process_handle: subprocess.Popen) -> str: - raise NotImplementedError("TODO") + """ + Add simple implementation of `get_process_status` which uses the status of the SSH process + and not of the `async process` in order to detect its termination + """ + pid = process_handle.pid + status = shell_out( + f"ps -q {pid} -o state --no-headers", + print_input=False, + print_output=False, + print_env=False, + print_curdir=False, + print_file_shell_cmd=False, + ) + return status.strip() def path_exists(self, path: PathType) -> bool: try: