1
0
mirror of https://github.com/esphome/esphome.git synced 2025-09-12 08:12:22 +01:00
This commit is contained in:
J. Nick Koston
2025-06-23 11:56:09 +02:00
parent 0773819778
commit 0eea1c0e40

View File

@@ -27,10 +27,11 @@ async def test_api_reboot_timeout(
async with run_compiled(yaml_config, line_callback=check_output): async with run_compiled(yaml_config, line_callback=check_output):
# Wait for up to 3 seconds for the reboot to occur # Wait for up to 3 seconds for the reboot to occur
# (1s timeout + some margin for processing) # (1s timeout + some margin for processing)
start_time = asyncio.get_event_loop().time() loop = asyncio.get_running_loop()
start_time = loop.time()
while not reboot_detected: while not reboot_detected:
await asyncio.sleep(0.1) await asyncio.sleep(0.1)
elapsed = asyncio.get_event_loop().time() - start_time elapsed = loop.time() - start_time
if elapsed > 3.0: if elapsed > 3.0:
pytest.fail("Device did not reboot within expected timeout") pytest.fail("Device did not reboot within expected timeout")