Skip to content

[health] Async @health_check methods always report an error #63 - #89

Merged
manish-wekan merged 2 commits into
nitrocloudofficial:developfrom
Shreyavemana:fix/async-health-checks
Oct 27, 2026
Merged

manish-wekan merged 2 commits into
nitrocloudofficial:developfrom
Shreyavemana:fix/async-health-checks

Conversation

@Shreyavemana

Copy link
Copy Markdown
Collaborator

Summary

Fixes #63.

Async @health_check methods were failing when accessed through health://status because HealthCheckRegistry.run_all() used run_until_complete() inside an already running event loop. This resulted in:

error: This event loop is already running

and unawaited coroutine warnings.

Changes

  • Made HealthCheckRegistry.run_all() asynchronous.
  • Await coroutine-based health checks directly.
  • Updated health_status_resource to await HealthCheckRegistry.run_all().
  • Updated existing health check tests to use the async API.
  • Added dedicated tests covering async health check behavior.

Tests

Added:

  • tests/test_health_async_checks.py
    • Async and sync health checks both report healthy.
    • A failing health check reports its own error without affecting other checks.
    • No RuntimeWarning: coroutine was never awaited warnings under -W error::RuntimeWarning.

Updated:

  • tests/test_decorators_extra.py
    • Existing run_all() tests updated for the async implementation.

Verification

@Shreyavemana
Shreyavemana changed the base branch from main to develop October 25, 2026 14:27
@Shreyavemana
Shreyavemana force-pushed the fix/async-health-checks branch from b8b7324 to 3a96917 Compare October 25, 2026 14:29
@Shreyavemana
Shreyavemana force-pushed the fix/async-health-checks branch from 3a96917 to 234b32a Compare October 25, 2026 16:34

@AadarshM07 AadarshM07 left a comment •

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, the changes seems to address what issue #63 demands. tests also passes.

@manish-wekan
manish-wekan merged commit 222b9f8 into nitrocloudofficial:develop Oct 27, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[health] Async @health_check methods always report an error

3 participants