Skip to content

Commit d578014

Browse files
authored
Fix flaky test_calls_not_allowed by using thread-safe event signaling (home-assistant#158504)
1 parent 4495a76 commit d578014

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tests/components/voip/test_voip.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,8 @@ def send_audio(audio_bytes: bytes, **kwargs):
115115

116116
# Should be problem.pcm from components/voip
117117
played_audio_bytes = audio_bytes
118-
done.set()
118+
# Use call_soon_threadsafe because send_audio runs in an executor thread
119+
hass.loop.call_soon_threadsafe(done.set)
119120

120121
protocol.transport = Mock()
121122
protocol.loop_delay = 0

0 commit comments

Comments
 (0)