Skip to content

Commit

Permalink
improved error handling in perf test framework
Browse files Browse the repository at this point in the history
Signed-off-by: George Pisaltu <gpl@amazon.com>
  • Loading branch information
georgepisaltu authored and dianpopa committed Jul 9, 2021
1 parent 86340cb commit 819ff16
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 6 additions & 2 deletions tests/framework/matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
"""

import os
import sys
import traceback
from framework.artifacts import ARTIFACTS_LOCAL_ROOT
from framework.utils import ExceptionAggregator

Expand Down Expand Up @@ -115,8 +117,10 @@ def _backtrack(self, test_fn, cartesian_product):
if len(self._sets) == len(cartesian_product):
try:
self._run_test_fn(cartesian_product, test_fn)
except Exception as err: # pylint: disable=W0703
self._failure_aggregator.add_row(err)
except Exception as _err: # pylint: disable=W0703
self._failure_aggregator.add_row(
"".join(traceback.format_exception(*sys.exc_info()))
)
return

current_set = self._sets[self._set_index]
Expand Down
3 changes: 2 additions & 1 deletion tests/framework/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
import threading
import typing
import time

from collections import namedtuple, defaultdict
import psutil
from retry import retry
Expand Down Expand Up @@ -287,7 +288,7 @@ def has_any(self) -> bool:

def __str__(self):
"""Return custom as string implementation."""
return "\n".join(self.failures)
return "\n\n".join(self.failures)


def search_output_from_cmd(cmd: str,
Expand Down

0 comments on commit 819ff16

Please sign in to comment.