From f91a113de758e824b4ba5d583a7701870ffbfeda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aleix=20Conchillo=20Flaqu=C3=A9?= Date: Fri, 10 Apr 2026 17:37:50 -0700 Subject: [PATCH] tests: yield in wake phrase strategy setup to let tasks start The strategy schedules background tasks during setup. Fast-running tests could observe state before those tasks had a chance to run; yielding once via asyncio.sleep(0) ensures they do. --- tests/test_wake_phrase_user_turn_start_strategy.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_wake_phrase_user_turn_start_strategy.py b/tests/test_wake_phrase_user_turn_start_strategy.py index e79b9ab99..0451f72c9 100644 --- a/tests/test_wake_phrase_user_turn_start_strategy.py +++ b/tests/test_wake_phrase_user_turn_start_strategy.py @@ -33,6 +33,8 @@ class TestWakePhraseUserTurnStartStrategy(unittest.IsolatedAsyncioTestCase): loop = asyncio.get_running_loop() task_manager.setup(TaskManagerParams(loop=loop)) await strategy.setup(task_manager) + # The tests are quick, so make sure the schedule starts all tasks. + await asyncio.sleep(0) return task_manager async def test_wake_phrase_in_final_transcription(self):