- print("Test suite `" + FileReader().filename + "': NOK (<" +
- cmdName + "> timeout after " + str(self.timeout) + " sec)")
- kill_process_group(pgtokill)
- tesh_exit(3)
+ timeout_reached = True
+ logs.append("Test suite `{file}': NOK (<{cmd}> timeout after {timeout} sec)".format(
+ file=FileReader().filename, cmd=cmd_name, timeout=self.timeout))
+ TeshState().running_pids.remove(local_pid)
+ kill_process_group(local_pid)
+ # Try to get the output of the timeout process, to help in debugging.
+ try:
+ (stdout_data, _stderr_data) = proc.communicate(timeout=1)
+ except subprocess.TimeoutExpired:
+ logs.append("[{file}:{number}] Could not retrieve output. Killing the process group failed?".format(
+ file=FileReader().filename, number=self.linenumber))
+ TeshState().set_return_code(3)
+ print('\n'.join(logs))
+ return