mirror of
https://github.com/home-assistant/core.git
synced 2025-12-24 12:59:34 +00:00
Add timeouts in stream tests to prevent possible hangs (#47545)
* Add timeouts on recving packets Add a timeout when recving packets from the worker thread in case it hangs. Add an exit condition just in case the while loop goes on forever. * Add a timeout to recorder thread join. * Wait for recorder thread to be invoked in tests Remove the while loop and instead wait for segments to be produced by the background worker thread. * Allow worker to resume before stopping to fix timeouts * Lower test timeout further * Remove test_stream_ended since it is flaky This test doesn't really add additional value on top of other tests.
This commit is contained in:
@@ -32,6 +32,7 @@ class WorkerSync:
|
||||
|
||||
def resume(self):
|
||||
"""Allow the worker thread to finalize the stream."""
|
||||
logging.debug("waking blocked worker")
|
||||
self._event.set()
|
||||
|
||||
def blocking_finish(self, stream: Stream):
|
||||
|
||||
Reference in New Issue
Block a user