Skip to content

Use no timeout for Core lifecycle calls#372

Open
agners wants to merge 1 commit into
mainfrom
core-lifecycle-timeout-none
Open

Use no timeout for Core lifecycle calls#372
agners wants to merge 1 commit into
mainfrom
core-lifecycle-timeout-none

Conversation

@agners

@agners agners commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

restart, stop, start and rebuild on HomeAssistantClient are long-running lifecycle operations, but they inherited DEFAULT_TIMEOUT = ClientTimeout(total=10). This mirrors the fix already in place for update(), which passes timeout=None.

Especially since home-assistant/supervisor#7018, the restart timeout was probably not very problematic since Core got rejected or restarted immediately anyways. Now that a restart queues behind the start job, the request is held server-side for >10s → SupervisorTimeoutError, even though the restart itself succeeds. Passing timeout=None removes the spurious error.

check_config is intentionally left on the default timeout — it is not a queued lifecycle operation.

Test plan

  • pytest tests/test_homeassistant.py
  • ruff check / ruff format --check

🤖 Generated with Claude Code

The restart, stop, start and rebuild calls for Home Assistant Core are
long-running lifecycle operations that may be held server-side while
queued behind other jobs (e.g. a self-restart queuing behind the start
job with GROUP_QUEUE). These inherited DEFAULT_TIMEOUT (total=10s),
which could raise a spurious SupervisorTimeoutError even though the
operation succeeds.

Pass timeout=None for these calls, matching the existing behavior of
update().

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.56%. Comparing base (c80880b) to head (0720163).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #372   +/-   ##
=======================================
  Coverage   99.56%   99.56%           
=======================================
  Files          34       34           
  Lines        1387     1387           
=======================================
  Hits         1381     1381           
  Misses          6        6           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@agners agners added the bugfix Inconsistencies or issues which will cause a problem for users or implementers. label Jul 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bugfix Inconsistencies or issues which will cause a problem for users or implementers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant