From a3f3b0bed49f8d830f1e31cb1df3a70699391b43 Mon Sep 17 00:00:00 2001 From: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Date: Tue, 31 Mar 2026 16:21:26 +0200 Subject: [PATCH] Fix lingering tasks in update_coordinator test (#166968) --- tests/helpers/test_update_coordinator.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/tests/helpers/test_update_coordinator.py b/tests/helpers/test_update_coordinator.py index 77a3c90ee0e..d4a35c7aa55 100644 --- a/tests/helpers/test_update_coordinator.py +++ b/tests/helpers/test_update_coordinator.py @@ -534,7 +534,7 @@ async def test_update_locks( # Add subscriber update_callback = Mock() - crd.async_add_listener(update_callback) + remove_callbacks = crd.async_add_listener(update_callback) assert crd.update_interval @@ -578,6 +578,10 @@ async def test_update_locks( # Unblock queued update block.set() + # Remove callbacks to avoid lingering timers + remove_callbacks() + await crd.async_shutdown() + async def test_refresh_recover( crd: update_coordinator.DataUpdateCoordinator[int], caplog: pytest.LogCaptureFixture