Fix flaky stream tests due to race in idle timeout callback (#46687)

This commit is contained in:
Allen Porter 2021-02-17 01:05:50 -08:00 committed by GitHub
parent 971e27dd80
commit efb172cedd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -141,8 +141,9 @@ class Stream:
"""Reset access token and cleanup stream due to inactivity.""" """Reset access token and cleanup stream due to inactivity."""
self.access_token = None self.access_token = None
if not self.keepalive: if not self.keepalive:
self._hls.cleanup() if self._hls:
self._hls = None self._hls.cleanup()
self._hls = None
self._hls_timer = None self._hls_timer = None
self._check_idle() self._check_idle()