From f00b4d4bb9b49c5429d08c5e46bf51a94e6f3c81 Mon Sep 17 00:00:00 2001 From: Zhaohui Sun Date: Thu, 10 Apr 2025 08:27:14 +0000 Subject: [PATCH 1/2] Print the matched syslog for loganalzyer matched syslog Signed-off-by: Zhaohui Sun --- tests/common/helpers/parallel.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/tests/common/helpers/parallel.py b/tests/common/helpers/parallel.py index 7dccecf8590..ecb5c1578c4 100644 --- a/tests/common/helpers/parallel.py +++ b/tests/common/helpers/parallel.py @@ -211,12 +211,15 @@ def force_terminate(workers, init_result): p_exception = process['exception'][0] p_traceback = process['exception'][1] p_exitcode = process['exit_code'] - pt_assert( - False, - 'Processes "{}" failed with exit code "{}"\nException:\n{}\nTraceback:\n{}'.format( - list(failed_processes.keys()), p_exitcode, p_exception, p_traceback + # For analyzed matched syslog, don't need to log the traceback + if "analyze_logs" in process_name and "Match Messages" in str(p_exception): + failure_message = 'Got matched syslog in processes "{}" exit code:"{}"\n{}'.format( + list(failed_processes.keys()), p_exitcode, p_exception ) - ) + else: + failure_message = 'Processes "{}" failed with exit code "{}"\nException:\n{}\nTraceback:\n{}'.format( + list(failed_processes.keys()), p_exitcode, p_exception, p_traceback) + pt_assert(False, failure_message) logger.info( 'Completed running processes for target "{}" in {} seconds'.format( From c92ed28875ad8e5d3ef1c49cf474b82dd39815e8 Mon Sep 17 00:00:00 2001 From: Zhaohui Sun Date: Thu, 10 Apr 2025 08:37:05 +0000 Subject: [PATCH 2/2] Only print process name Signed-off-by: Zhaohui Sun --- tests/common/helpers/parallel.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/common/helpers/parallel.py b/tests/common/helpers/parallel.py index ecb5c1578c4..e11fd73a791 100644 --- a/tests/common/helpers/parallel.py +++ b/tests/common/helpers/parallel.py @@ -214,7 +214,7 @@ def force_terminate(workers, init_result): # For analyzed matched syslog, don't need to log the traceback if "analyze_logs" in process_name and "Match Messages" in str(p_exception): failure_message = 'Got matched syslog in processes "{}" exit code:"{}"\n{}'.format( - list(failed_processes.keys()), p_exitcode, p_exception + process_name, p_exitcode, p_exception ) else: failure_message = 'Processes "{}" failed with exit code "{}"\nException:\n{}\nTraceback:\n{}'.format(