Skip to content

tests: fix flaky HLS test #6536

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 22, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
tests: fix flaky HLS test
  • Loading branch information
bastimeyer committed May 21, 2025
commit c5262bb7acda75f6168ad9ccaa5cc35d847418ac
8 changes: 8 additions & 0 deletions tests/stream/hls/test_hls.py
Original file line number Diff line number Diff line change
Expand Up @@ -434,6 +434,14 @@ def test_segment_queue_timing_threshold_reached_min(self) -> None:
self.await_playlist_wait(1)
self.await_playlist_reload(1)

# FIXME: NO-GIL
# Closing only the worker thread when no new segments were queued keeps the writer thread and buffer still open,
# which is why the test's reader thread keeps running until the test teardown,
# but this somehow breaks the assertion down below, so close everything manually...
# These tests will have to be rewritten eventually in pytest-style, without having to mock log calls.
self.thread.close()
self.thread.join(1)

assert mock_log.warning.call_args_list == [call("No new segments in playlist for more than 5.00s. Stopping...")]

def test_playlist_reload_offset(self) -> None:
Expand Down