From cac393104b8f0045570ae23633d16f78c239ed8b Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Wed, 30 Sep 2026 13:04:09 +0200 Subject: [PATCH] Fix flaky nest test_remove_stale_media (#183728) Co-authored-by: Claude Opus 5.5 --- tests/components/nest/test_media_source.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/tests/components/nest/test_media_source.py b/tests/components/nest/test_media_source.py index b3a4e1a85a32..865f0526ce98 100644 --- a/tests/components/nest/test_media_source.py +++ b/tests/components/nest/test_media_source.py @@ -1694,8 +1694,7 @@ async def test_remove_stale_media( point_in_time = dt_util.utcnow() + datetime.timedelta(days=1) with freeze_time(point_in_time): async_fire_time_changed(hass, point_in_time) - await hass.async_block_till_done() - await hass.async_block_till_done() + await hass.async_block_till_done(wait_background_tasks=True) # Verify that the event media is still present and that the extra files # are removed. Newer media is not removed.