Merge "Remove duplicate exception tracebacks from test reporting"

This commit is contained in:
Zuul 2020-08-08 03:05:22 +00:00 committed by Gerrit Code Review
commit afa575291d
2 changed files with 10 additions and 10 deletions

View File

@ -92,12 +92,12 @@ class ExceptionInfo(collections.namedtuple('ExceptionInfo',
def __enter__(self):
return self
def __bool__(self):
return self.type is not None
def __exit__(self, _type, _value, _traceback):
if self.reraise_on_exit:
if _type is not None:
LOG.exception("Exception occurred while handling %s(%s) "
"exception.", self.type, self.value)
self.reraise()
self.reraise()
def reraise(self):
if self.type is not None:

View File

@ -80,9 +80,9 @@ class RetryAttempt(object):
return max(0, self.count - self.number)
def check_count_left(self) -> _time.Seconds:
with _exception.exc_info():
if self.count_left == 0:
raise RetryCountLimitError(attempt=self)
if self.count_left == 0:
_exception.exc_info().reraise()
raise RetryCountLimitError(attempt=self)
return self.count_left
@property
@ -93,9 +93,9 @@ class RetryAttempt(object):
return max(0., self.timeout - self.elapsed_time)
def check_time_left(self) -> _time.Seconds:
with _exception.exc_info():
if self.time_left == 0.:
raise RetryTimeLimitError(attempt=self)
if self.time_left == 0.:
_exception.exc_info().reraise()
raise RetryTimeLimitError(attempt=self)
return self.time_left
def check_limits(self):