Skip to content

Commit 5d07c84

Browse files
committed
Added partial script output when timing out.
1 parent 6a23fa5 commit 5d07c84

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

render_machine/render_utils.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,8 +201,14 @@ def execute_script( # noqa: C901
201201
f"The {script_type} script timed out after {script_timeout} seconds. {script_type} script output stored in: {temp_file_path}"
202202
)
203203

204+
partial_output = ""
205+
if e.stdout:
206+
decoded = e.stdout.decode("utf-8") if isinstance(e.stdout, bytes) else e.stdout
207+
sanitized = _sanitize_script_output(decoded)
208+
if sanitized:
209+
partial_output = f"\nPartial test script output:\n{sanitized}"
204210
return (
205211
TIMEOUT_ERROR_EXIT_CODE,
206-
f"{script_type} script did not finish in {script_timeout} seconds.",
212+
f"{script_type} script did not finish in {script_timeout} seconds.{partial_output}",
207213
temp_file_path,
208214
)

0 commit comments

Comments
 (0)