From 5d07c843e76796ac4ec72f1ac5776f79c975efff Mon Sep 17 00:00:00 2001 From: VitjanZ Date: Thu, 9 Apr 2026 17:43:50 +0200 Subject: [PATCH] Added partial script output when timing out. --- render_machine/render_utils.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/render_machine/render_utils.py b/render_machine/render_utils.py index 310f96d..7e5f707 100644 --- a/render_machine/render_utils.py +++ b/render_machine/render_utils.py @@ -201,8 +201,14 @@ def execute_script( # noqa: C901 f"The {script_type} script timed out after {script_timeout} seconds. {script_type} script output stored in: {temp_file_path}" ) + partial_output = "" + if e.stdout: + decoded = e.stdout.decode("utf-8") if isinstance(e.stdout, bytes) else e.stdout + sanitized = _sanitize_script_output(decoded) + if sanitized: + partial_output = f"\nPartial test script output:\n{sanitized}" return ( TIMEOUT_ERROR_EXIT_CODE, - f"{script_type} script did not finish in {script_timeout} seconds.", + f"{script_type} script did not finish in {script_timeout} seconds.{partial_output}", temp_file_path, )