[action] [PR:17926] Only print the matched syslog in loganalzyer teardown check, no traceback info printed#17938
Open
mssonicbld wants to merge 1 commit intosonic-net:202405from
Open
Conversation
…back info printed (sonic-net#17926) What is the motivation for this PR? To make the failed summary of teardown loganalyzer shorter and clearer. It can make the summary easy to understand and downstream failure analyzer can do analysis based on clean summaries. The summary when a case failed in loganalzyer teardown phase: Before change: E Failed: Processes "['analyze_logs--<MultiAsicSonicHost str-msn4700-02>']" failed with exit code "1" E Exception: E match: 1 E expected_match: 0 E expected_missing_match: 0 E E Match Messages: E 2025 Apr 9 02:42:13.609855 str-msn4700-02 ERR kernel: [ 1820.284908] sxd_kernel: [error] Failed to bind BFD socket to local_addr (ip:104.0.0.74 ,port:49282) (err:-98). E Traceback: E Traceback (most recent call last): E File "/var/src/sonic-mgmt_vms11-t1-4700-6_6670b1f1e72b94cbabbdfe65/tests/common/helpers/parallel.py", line 35, in run E Process.run(self) E File "/usr/lib/python3.8/multiprocessing/process.py", line 108, in run E self._target(*self._args, **self._kwargs) E File "/var/src/sonic-mgmt_vms11-t1-4700-6_6670b1f1e72b94cbabbdfe65/tests/common/helpers/parallel.py", line 245, in wrapper E target(*args, **kwargs) E File "/var/src/sonic-mgmt_vms11-t1-4700-6_6670b1f1e72b94cbabbdfe65/tests/common/plugins/loganalyzer/__init__.py", line 45, in analyze_logs E dut_analyzer.analyze(markers[node.hostname], fail_test, store_la_logs=store_la_logs) E File "/var/src/sonic-mgmt_vms11-t1-4700-6_6670b1f1e72b94cbabbdfe65/tests/common/plugins/loganalyzer/loganalyzer.py", line 409, in analyze E self._verify_log(analyzer_summary) E File "/var/src/sonic-mgmt_vms11-t1-4700-6_6670b1f1e72b94cbabbdfe65/tests/common/plugins/loganalyzer/loganalyzer.py", line 140, in _verify_log E raise LogAnalyzerError(result_str) E tests.common.plugins.loganalyzer.loganalyzer.LogAnalyzerError: match: 1 E expected_match: 0 E expected_missing_match: 0 E E Match Messages: DEBUG:tests.conftest:[log_custom_msg] item: <Function test_bfd_multihop[ipv6]> INFO:root:Can not get Allure report URL. Please check logs E 2025 Apr 9 02:42:13.609855 str-msn4700-02 ERR kernel: [ 1820.284908] sxd_kernel: [error] Failed to bind BFD socket to local_addr (ip:104.0.0.74 ,port:49282) (err:-98). After change: E Failed: Got matched syslog in processes "analyze_logs--<MultiAsicSonicHost bjw2-can-7260-10>" exit code:"1" E match: 1 E expected_match: 0 E expected_missing_match: 0 E E Match Messages: E 2025 Apr 10 08:21:06.808698 bjw2-can-7260-10 ERR admin: [ 1820.284908] sxd_kernel: [error] Failed to bind BFD socket to local_addr (ip:104.0.0.74 ,port:49282) (err:-98) How did you do it? Check if the failed process is analyze_log and if there is Matched Messages in the exception, if so, just print the exception. Don't need to print the traceback, it ensures the summary is shorter and clearer. How did you verify/test it? Run a case failed in loganalyzer teardown phase, check the summary of the failed case Signed-off-by: Zhaohui Sun <[email protected]>
Merged
11 tasks
Collaborator
Author
|
Original PR: #17926 |
Collaborator
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
Author
|
/azp run Azure.sonic-mgmt |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
Author
|
/azp run Azure.sonic-mgmt |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description of PR
Summary:
Fixes # (issue)
Type of change
Back port request
Approach
What is the motivation for this PR?
To make the failed summary of teardown loganalyzer shorter and clearer. It can make the summary easy to understand and downstream failure analyzer can do analysis based on clean summaries.
The summary when a case failed in loganalzyer teardown phase:
Before change:
After change:
How did you do it?
Check if the failed process is analyze_log and if there is Matched Messages in the exception, if so, just print the exception. Don't need to print the traceback, it ensures the summary is shorter and clearer.
How did you verify/test it?
Run a case failed in loganalyzer teardown phase, check the summary of the failed case
Any platform specific information?
Supported testbed topology if it's a new test case?
Documentation