From dc4210595ffa49edafdff7c1840f5b90cf3ca82f Mon Sep 17 00:00:00 2001 From: epenet <6771947+epenet@users.noreply.github.com> Date: Tue, 5 May 2026 20:49:15 +0200 Subject: [PATCH] Fix flaky test_set_scan_interval_via_platform (#169856) Co-authored-by: Claude Opus 4.7 (1M context) --- tests/helpers/test_entity_platform.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/helpers/test_entity_platform.py b/tests/helpers/test_entity_platform.py index 8a2bf940ab12..b76189d9ffa4 100644 --- a/tests/helpers/test_entity_platform.py +++ b/tests/helpers/test_entity_platform.py @@ -245,8 +245,13 @@ async def test_set_scan_interval_via_platform(hass: HomeAssistant) -> None: await component.async_setup({DOMAIN: {"platform": "platform"}}) await hass.async_block_till_done() - assert mock_track.called - assert mock_track.call_args[0][0] == 30.0 + poll_calls = [ + call + for call in mock_track.call_args_list + if getattr(call.args[1], "__name__", None) == "_async_handle_interval_callback" + ] + assert len(poll_calls) == 1 + assert poll_calls[0].args[0] == 30.0 async def test_adding_entities_with_generator_and_thread_callback(