Skip to content

Commit

Permalink
tests: improve logging on failure
Browse files Browse the repository at this point in the history
It is helpful to print the error right at the point
of failure, rather than after the (potentially long
running) backtrace decode & log search jobs.

It'll get printed again later as well, but this way
I can search from the start of the file for the exception
name, and jump straight to the timestamp of the failure.
  • Loading branch information
jcsp committed Aug 8, 2022
1 parent 763381f commit d3a3087
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/rptest/services/cluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,13 @@ def wrapped(self, *args, **kwargs):
try:
r = f(self, *args, **kwargs)
except:
self.redpanda.logger.exception(
"Test failed, doing failure checks...")
self.redpanda.decode_backtraces()
self.redpanda.raise_on_crash()
raise
else:
self.redpanda.logger.info("Test passed, doing log checks...")
if check_allowed_error_logs:
# Only do log inspections on tests that are otherwise
# successful. This executes *before* the end-of-test
Expand Down

0 comments on commit d3a3087

Please sign in to comment.