From 6c3102e78cfc60167061c3c0283aadfec89e326c Mon Sep 17 00:00:00 2001 From: Jiri Jaburek Date: Mon, 19 Feb 2024 12:11:21 +0100 Subject: [PATCH] Flush automatus test logs before outputting results This ensures that logs contain all the test stdout/stderr outputs at the moment of automatus.py announcing their results on its output. This is useful for an external automatus.py wrapper, which parses its output in real-time, while also processing the logs in real-time. The flushing is done here and not deeper, because it seems unnecessary to flush after every 'retry' attempt, only when the test is done running and its result is about to be announced by automatus.py. Signed-off-by: Jiri Jaburek --- tests/ssg_test_suite/test_env.py | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/ssg_test_suite/test_env.py b/tests/ssg_test_suite/test_env.py index 11b89885d09..e4b490881fb 100644 --- a/tests/ssg_test_suite/test_env.py +++ b/tests/ssg_test_suite/test_env.py @@ -129,6 +129,7 @@ def execute_ssh_command(self, command, log_file, error_msg_template=None): remote_dest = "root@{ip}".format(ip=self.domain_ip) result = common.retry_with_stdout_logging( "ssh", tuple(self.ssh_additional_options) + (remote_dest, command), log_file) + log_file.flush() if result.returncode: error_msg = error_msg_template.format( command=command, remote_dest=remote_dest,