Skip to content

Commit 9738852

Browse files
rajkumar1-aristamssonicbld
authored andcommitted
Fix loganalyzer crash with Exception: pop from empty list (#19633)
What is the motivation for this PR? loganalyzer is crashing in case config_reload raising any exceptions. How did you do it? support_ignore_loganalyzer wrapper was not handling the addition of end_ignore_marker in case of wrapped function raised exceptions, added try and finally block to add end_ignore_marker
1 parent 5b8fb3e commit 9738852

1 file changed

Lines changed: 6 additions & 5 deletions

File tree

  • tests/common/plugins/loganalyzer

tests/common/plugins/loganalyzer/utils.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,12 @@ def decorated(*args, **kwargs):
2121
for _, dut_loganalyzer in list(loganalyzer.items()):
2222
dut_loganalyzer.add_start_ignore_mark()
2323

24-
res = func(*args, **kwargs)
25-
26-
if loganalyzer:
27-
for _, dut_loganalyzer in list(loganalyzer.items()):
28-
dut_loganalyzer.add_end_ignore_mark()
24+
try:
25+
res = func(*args, **kwargs)
26+
finally:
27+
if loganalyzer:
28+
for _, dut_loganalyzer in list(loganalyzer.items()):
29+
dut_loganalyzer.add_end_ignore_mark()
2930

3031
return res
3132

0 commit comments

Comments
 (0)