From 1d4e82bd3dc7864fe7f79c1dd93e73141b2c8126 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 26 Feb 2024 06:11:50 -1000 Subject: [PATCH] Fix race in dlna_dmr test (#111428) The entity was removed before the entity registry could update it ``` Traceback (most recent call last): File "/Users/bdraco/home-assistant/homeassistant/helpers/entity.py", line 1482, in _async_process_registry_update_or_remove assert registry_entry is not None AssertionError ``` --- tests/components/dlna_dmr/test_media_player.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/components/dlna_dmr/test_media_player.py b/tests/components/dlna_dmr/test_media_player.py index 67c7bbe61c5..1da970c4c92 100644 --- a/tests/components/dlna_dmr/test_media_player.py +++ b/tests/components/dlna_dmr/test_media_player.py @@ -2043,6 +2043,8 @@ async def test_poll_availability( # Check that an update will poll the device for availability domain_data_mock.upnp_factory.async_create_device.reset_mock() await async_update_entity(hass, mock_entity_id) + await hass.async_block_till_done() + domain_data_mock.upnp_factory.async_create_device.assert_awaited_once_with( MOCK_DEVICE_LOCATION ) @@ -2057,6 +2059,8 @@ async def test_poll_availability( # Check that an update will notice the device and connect to it domain_data_mock.upnp_factory.async_create_device.reset_mock() await async_update_entity(hass, mock_entity_id) + await hass.async_block_till_done() + domain_data_mock.upnp_factory.async_create_device.assert_awaited_once_with( MOCK_DEVICE_LOCATION )