1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-25 05:26:47 +00:00

Make stream recorder work concurrently (#73478)

This commit is contained in:
uvjustin
2022-06-18 05:13:07 +10:00
committed by GitHub
parent 600d23e052
commit 7a3f632c1d
8 changed files with 297 additions and 306 deletions

View File

@@ -506,10 +506,12 @@ async def test_remove_incomplete_segment_on_exit(
assert len(segments) == 3
assert not segments[-1].complete
stream_worker_sync.resume()
stream._thread_quit.set()
stream._thread.join()
stream._thread = None
await hass.async_block_till_done()
assert segments[-1].complete
assert len(segments) == 2
with patch("homeassistant.components.stream.Stream.remove_provider"):
# Patch remove_provider so the deque is not cleared
stream._thread_quit.set()
stream._thread.join()
stream._thread = None
await hass.async_block_till_done()
assert segments[-1].complete
assert len(segments) == 2
await stream.stop()