From 19e191b61e201789c02385854f00cc6deedeff54 Mon Sep 17 00:00:00 2001 From: Ajay Raj Date: Tue, 9 Jul 2024 15:11:10 -0700 Subject: [PATCH] change while condition --- tests/streaming/action/test_dtmf.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/streaming/action/test_dtmf.py b/tests/streaming/action/test_dtmf.py index bef0f62e6..026779c0a 100644 --- a/tests/streaming/action/test_dtmf.py +++ b/tests/streaming/action/test_dtmf.py @@ -109,8 +109,13 @@ async def test_twilio_dtmf_press_digits( ) mock_twilio_output_device.start() - while not mock_twilio_output_device._twilio_events_queue.empty(): + max_wait_seconds = 1 + waited_seconds = 0 + while mock_twilio_output_device.ws.send_text.call_count < len(digits): await asyncio.sleep(0.1) + waited_seconds += 0.1 + if waited_seconds > max_wait_seconds: + assert False, "Timed out waiting for DTMF tones to be sent" assert action_output.response.success mock_twilio_output_device.terminate()