Skip to content

Commit

Permalink
timeout errors are critical
Browse files Browse the repository at this point in the history
  • Loading branch information
yrro committed Mar 13, 2024
1 parent 9eaab1f commit 14294d0
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
3 changes: 1 addition & 2 deletions src/ipahealthcheck/core/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,7 @@ def signal_handler(signum, frame):
# caught our TimeoutError and logged something misleading; in that
# case let's err on the side of caution and return an additional
# result.
# TODO: suggest that timeouts are CRITICAL?
yield Result(plugin, constants.ERROR,
yield Result(plugin, constants.CRITICAL,
exception=str(timed_out["exception"]),
key="healthcheck_timeout", start=start,
traceback=timed_out["stack"])
Expand Down
8 changes: 4 additions & 4 deletions tests/test_plugins.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,13 +87,13 @@ def check(self):
assert results.results[0].kw.get('exception') == 'Check' \
' test_plugins:plugin_slow_passing_exception_up' \
' cancelled after 1 sec'
assert results.results[0].result == constants.ERROR
assert results.results[0].result == constants.CRITICAL
assert results.results[0].kw.get('key') == 'healthcheck_timeout'

assert results.results[1].kw.get('exception') == 'Check' \
' test_plugins:plugin_slow_catching_exception_and_ignoring' \
' cancelled after 1 sec'
assert results.results[1].result == constants.ERROR
assert results.results[1].result == constants.CRITICAL
assert results.results[1].kw.get('key') == 'healthcheck_timeout'

assert results.results[2].kw.get('exception') == 'Check' \
Expand All @@ -106,7 +106,7 @@ def check(self):
assert results.results[3].kw.get('exception') == 'Check' \
' test_plugins:plugin_slow_catching_exception_and_handling' \
' cancelled after 1 sec'
assert results.results[3].result == constants.ERROR
assert results.results[3].result == constants.CRITICAL
assert results.results[3].kw.get('key') == 'healthcheck_timeout'

assert results.results[4].kw.get('exception') == "I didn't expect an" \
Expand All @@ -116,7 +116,7 @@ def check(self):

assert results.results[5].kw.get('exception') == 'Check' \
' test_plugins:plugin_slow_raising_exception cancelled after 1 sec'
assert results.results[5].result == constants.ERROR
assert results.results[5].result == constants.CRITICAL
assert results.results[5].kw.get('key') == 'healthcheck_timeout'

assert results.results[6].kw.get('msg') == 'pass'
Expand Down

0 comments on commit 14294d0

Please sign in to comment.