Skip to content

Commit

Permalink
change while condition
Browse files Browse the repository at this point in the history
  • Loading branch information
ajar98 committed Jul 9, 2024
1 parent 6a39c4b commit 19e191b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion tests/streaming/action/test_dtmf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down

0 comments on commit 19e191b

Please sign in to comment.