From ad0aabe9a1f50c47017d8d0f01e818df238d3d2c Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Sun, 28 Apr 2024 09:21:32 -0500 Subject: [PATCH] Fix some flapping sonos tests (#116343) --- tests/components/sonos/test_repairs.py | 1 + tests/components/sonos/test_switch.py | 1 + 2 files changed, 2 insertions(+) diff --git a/tests/components/sonos/test_repairs.py b/tests/components/sonos/test_repairs.py index 49b87b272d6..2fa951c6a79 100644 --- a/tests/components/sonos/test_repairs.py +++ b/tests/components/sonos/test_repairs.py @@ -47,3 +47,4 @@ async def test_subscription_repair_issues( sub_callback(event) await hass.async_block_till_done() assert not issue_registry.async_get_issue(DOMAIN, SUB_FAIL_ISSUE_ID) + await hass.async_block_till_done(wait_background_tasks=True) diff --git a/tests/components/sonos/test_switch.py b/tests/components/sonos/test_switch.py index d6814886d55..11ce1aa5ddb 100644 --- a/tests/components/sonos/test_switch.py +++ b/tests/components/sonos/test_switch.py @@ -122,6 +122,7 @@ async def test_switch_attributes( # Trigger subscription callback for speaker discovery await fire_zgs_event() + await hass.async_block_till_done(wait_background_tasks=True) status_light_state = hass.states.get(status_light.entity_id) assert status_light_state.state == STATE_ON