Mark executor jobs as background unless created from a tracked task (#114450)
* Mark executor jobs as background unless created from a tracked task If the current task is not tracked the executor job should not be a background task to avoid delaying startup and shutdown. Currently any executor job created in a untracked task or background task would end up being tracked and delaying startup/shutdown * import exec has the same issue * Avoid tracking import executor jobs There is no reason to track these jobs as they are always awaited and we do not want to support fire and forget import executor jobs * fix xiaomi_miio * lots of fire time changed without background await * revert changes moved to other PR * more * more * more * m * m * p * fix fire and forget tests * scrape * sonos * system * more * capture callback before block * coverage * more * more races * more races * more * missed some * more fixes * missed some more * fix * remove unneeded * one more race * two
This commit is contained in:
parent
aec7a67a58
commit
9a79320861
46 changed files with 246 additions and 180 deletions
|
@ -278,7 +278,7 @@ async def test_setup_nvr_errors_during_indexing(
|
|||
mock_remote.return_value.index.side_effect = None
|
||||
|
||||
async_fire_time_changed(hass, now + timedelta(seconds=31))
|
||||
await hass.async_block_till_done()
|
||||
await hass.async_block_till_done(wait_background_tasks=True)
|
||||
|
||||
camera_states = hass.states.async_all("camera")
|
||||
|
||||
|
@ -313,7 +313,7 @@ async def test_setup_nvr_errors_during_initialization(
|
|||
mock_remote.side_effect = None
|
||||
|
||||
async_fire_time_changed(hass, now + timedelta(seconds=31))
|
||||
await hass.async_block_till_done()
|
||||
await hass.async_block_till_done(wait_background_tasks=True)
|
||||
|
||||
camera_states = hass.states.async_all("camera")
|
||||
|
||||
|
@ -362,7 +362,7 @@ async def test_motion_recording_mode_properties(
|
|||
] = True
|
||||
|
||||
async_fire_time_changed(hass, now + timedelta(seconds=31))
|
||||
await hass.async_block_till_done()
|
||||
await hass.async_block_till_done(wait_background_tasks=True)
|
||||
|
||||
state = hass.states.get("camera.front")
|
||||
|
||||
|
@ -375,7 +375,7 @@ async def test_motion_recording_mode_properties(
|
|||
mock_remote.return_value.get_camera.return_value["recordingIndicator"] = "DISABLED"
|
||||
|
||||
async_fire_time_changed(hass, now + timedelta(seconds=61))
|
||||
await hass.async_block_till_done()
|
||||
await hass.async_block_till_done(wait_background_tasks=True)
|
||||
|
||||
state = hass.states.get("camera.front")
|
||||
|
||||
|
@ -387,7 +387,7 @@ async def test_motion_recording_mode_properties(
|
|||
)
|
||||
|
||||
async_fire_time_changed(hass, now + timedelta(seconds=91))
|
||||
await hass.async_block_till_done()
|
||||
await hass.async_block_till_done(wait_background_tasks=True)
|
||||
|
||||
state = hass.states.get("camera.front")
|
||||
|
||||
|
@ -399,7 +399,7 @@ async def test_motion_recording_mode_properties(
|
|||
)
|
||||
|
||||
async_fire_time_changed(hass, now + timedelta(seconds=121))
|
||||
await hass.async_block_till_done()
|
||||
await hass.async_block_till_done(wait_background_tasks=True)
|
||||
|
||||
state = hass.states.get("camera.front")
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue