mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Replace periodic tasks with background tasks (#112726)
* Phase out periodic tasks * false by default or some tests will block forever, will need to fix each one manually * kwarg works * kwarg works * kwarg works * fixes * fix more tests * fix more tests * fix lifx * opensky * pvpc_hourly_pricing * adjust more * adjust more * smarttub * adjust more * adjust more * adjust more * adjust more * adjust * no eager executor * zha * qnap_qsw * fix more * fix fix * docs * its a wrapper now * add more coverage * coverage * cover all combos * more fixes * more fixes * more fixes * remaining issues are legit bugs in tests * make tplink test more predictable * more fixes * feedreader * grind out some more * make test race safe * one more
This commit is contained in:
@@ -350,7 +350,7 @@ async def test_switch_command_state_fail(
|
||||
await hass.async_block_till_done()
|
||||
|
||||
async_fire_time_changed(hass, dt_util.utcnow() + SCAN_INTERVAL)
|
||||
await hass.async_block_till_done()
|
||||
await hass.async_block_till_done(wait_background_tasks=True)
|
||||
|
||||
entity_state = hass.states.get("switch.test")
|
||||
assert entity_state
|
||||
@@ -734,7 +734,7 @@ async def test_availability(
|
||||
hass.states.async_set("sensor.input1", "on")
|
||||
freezer.tick(timedelta(minutes=1))
|
||||
async_fire_time_changed(hass)
|
||||
await hass.async_block_till_done()
|
||||
await hass.async_block_till_done(wait_background_tasks=True)
|
||||
|
||||
entity_state = hass.states.get("switch.test")
|
||||
assert entity_state
|
||||
@@ -745,7 +745,7 @@ async def test_availability(
|
||||
with mock_asyncio_subprocess_run(b"50\n"):
|
||||
freezer.tick(timedelta(minutes=1))
|
||||
async_fire_time_changed(hass)
|
||||
await hass.async_block_till_done()
|
||||
await hass.async_block_till_done(wait_background_tasks=True)
|
||||
|
||||
entity_state = hass.states.get("switch.test")
|
||||
assert entity_state
|
||||
|
||||
Reference in New Issue
Block a user