mirror of
https://github.com/home-assistant/core.git
synced 2026-09-16 21:48:38 +01:00
Assert retry_after propagation in teslemetry coordinator retry tests (#181721)
This commit is contained in:
@@ -4,6 +4,7 @@ import asyncio
|
||||
from collections.abc import AsyncIterator
|
||||
from contextlib import asynccontextmanager
|
||||
from copy import deepcopy
|
||||
from datetime import timedelta
|
||||
import logging
|
||||
import time
|
||||
from types import MappingProxyType
|
||||
@@ -686,6 +687,18 @@ async def test_energy_history_coordinator_retry_exceptions(
|
||||
# Entry stays loaded - UpdateFailed with retry_after doesn't break the entry
|
||||
assert entry.state is ConfigEntryState.LOADED
|
||||
|
||||
# The coordinator staggers its scheduling deliberately, so these ticks
|
||||
# bracket retry_after with a margin either side rather than sitting on it.
|
||||
freezer.tick(timedelta(seconds=expected_retry_after - 2))
|
||||
async_fire_time_changed(hass)
|
||||
await hass.async_block_till_done()
|
||||
assert call_count == 1
|
||||
|
||||
freezer.tick(timedelta(seconds=3))
|
||||
async_fire_time_changed(hass)
|
||||
await hass.async_block_till_done()
|
||||
assert call_count == 2
|
||||
|
||||
|
||||
async def test_live_status_auth_error(
|
||||
hass: HomeAssistant,
|
||||
|
||||
Reference in New Issue
Block a user