Skip to content

Commit

Permalink
Add warning for logging errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ekouts committed Jan 8, 2025
1 parent eb01cde commit 32e6bca
Showing 1 changed file with 16 additions and 5 deletions.
21 changes: 16 additions & 5 deletions reframe/frontend/executors/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@
import reframe.utility.jsonext as jsonext
import reframe.utility.typecheck as typ
from reframe.core.exceptions import (AbortTaskError,
JobNotStartedError,
FailureLimitError,
ForceExitError,
JobNotStartedError,
LoggingError,
RunSessionTimeout,
SkipTestError,
StatisticsError,
Expand Down Expand Up @@ -480,8 +481,13 @@ def finalize(self):

self._current_stage = 'finalize'
self._notify_listeners('on_task_success')
self._perflogger.log_performance(logging.INFO, self,
multiline=self._perflog_compat)
try:
self._perflogger.log_performance(logging.INFO, self,
multiline=self._perflog_compat)
except LoggingError as e:
logging.getlogger().warning(
f'could not log performance data for {self.testcase}: {e}'
)

@logging.time_function
def cleanup(self, *args, **kwargs):
Expand All @@ -491,8 +497,13 @@ def fail(self, exc_info=None, callback='on_task_failure'):
self._failed_stage = self._current_stage
self._exc_info = exc_info or sys.exc_info()
self._notify_listeners(callback)
self._perflogger.log_performance(logging.INFO, self,
multiline=self._perflog_compat)
try:
self._perflogger.log_performance(logging.INFO, self,
multiline=self._perflog_compat)
except LoggingError as e:
logging.getlogger().warning(
f'could not log performance data for {self.testcase}: {e}'
)

def skip(self, exc_info=None):
self._skipped = True
Expand Down

0 comments on commit 32e6bca

Please sign in to comment.