Skip to content

Commit

Permalink
Flush automatus test logs before outputting results
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
comps committed Feb 19, 2024
1 parent 087d023 commit 6c3102e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions tests/ssg_test_suite/test_env.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 6c3102e

Please sign in to comment.