tests: refactor thread handshakes#5017
Merged
Merged
Conversation
741a1f9 to
bda5402
Compare
gravyboat
approved these changes
Dec 8, 2022
gravyboat
left a comment
Member
There was a problem hiding this comment.
@bastimeyer My review is primarily based on the prior commit you pushed but I don't see any significant differences between them unless I'm missing something. Looks good, minor question around a name but otherwise 👍
snorkelopstesting3-bot
pushed a commit
to snorkel-marlin-repos/streamlink_streamlink_pr_5017_36c2174a-eb9a-49c3-878f-463624b9a4d0
that referenced
this pull request
Oct 22, 2025
Original PR #5017 by bastimeyer Original: streamlink/streamlink#5017
snorkelopstesting3-bot
added a commit
to snorkel-marlin-repos/streamlink_streamlink_pr_5017_36c2174a-eb9a-49c3-878f-463624b9a4d0
that referenced
this pull request
Oct 22, 2025
Merged from original PR #5017 Original: streamlink/streamlink#5017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This cleans up and simplifies the HLS test mixins by implementing a generic thread-handshake class for synchronizing code execution between two threads: application logic (producer thread) and tests (consumer/main thread), with optional error capturing. The previous implementation was using a similar setup in multiple different classes. This is now defined with a proper interface and proper method names, for much better readability of the tests.
I've also added support for async coroutines in case this is required at some point. And I added tests for the new
tests.testutils.handshake.Handshakeclass, so that it doesn't get tested implicitly via the other tests.This work is required for my code refactoring of the CLI's
read_stream()stuff (see #4974 - not yet finished), because I didn't want to redefine the same handshake stuff over and over again. Including this work in a single PR would've been a bit too much, so that's why I'm opening this one here first.