Fix missing await when running shutdown jobs (#106632)

This commit is contained in:
Erik Montnemery
2023-12-29 10:04:16 +01:00
committed by GitHub
parent 7702f971fb
commit a4e9a053c7
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -2605,6 +2605,9 @@ async def test_shutdown_job(hass: HomeAssistant) -> None:
evt = asyncio.Event()
async def shutdown_func() -> None:
# Sleep to ensure core is waiting for the task to finish
await asyncio.sleep(0.01)
# Set the event
evt.set()
job = HassJob(shutdown_func, "shutdown_job")