From 14611f9b5ccf54c76aa6cdb67fd97f03f45a7877 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Tue, 13 Sep 2022 22:40:08 +0200 Subject: [PATCH] Fix race in logbook websocket test (#78390) --- tests/components/logbook/test_websocket_api.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/components/logbook/test_websocket_api.py b/tests/components/logbook/test_websocket_api.py index 4b2c40f41c0..a7bd28f0e4d 100644 --- a/tests/components/logbook/test_websocket_api.py +++ b/tests/components/logbook/test_websocket_api.py @@ -2440,8 +2440,6 @@ async def test_subscribe_entities_some_have_uom_multiple( await get_instance(hass).async_block_till_done() await hass.async_block_till_done() - _cycle_entities() - await hass.async_block_till_done() msg = await asyncio.wait_for(websocket_client.receive_json(), 2) assert msg["id"] == 7 @@ -2450,6 +2448,10 @@ async def test_subscribe_entities_some_have_uom_multiple( assert msg["event"]["events"] == [] _cycle_entities() + await get_instance(hass).async_block_till_done() + await hass.async_block_till_done() + _cycle_entities() + await get_instance(hass).async_block_till_done() await hass.async_block_till_done() msg = await asyncio.wait_for(websocket_client.receive_json(), 2)