test: cover the sync SSE client and bucket range serialization - #115
Open
vazarkevych wants to merge 1 commit into
Open
vazarkevych wants to merge 1 commit into
vazarkevych wants to merge 1 commit into
Conversation
vazarkevych
force-pushed
the
test/upgrade-test-coverage
branch
from
September 17, 2026 10:23
be8d13c to
629d761
Compare
Rebuilt on top of current main as a single test-only commit; the original branch's source change (multi-line `data:` joining in `_process_response`) is already in main, fixed there independently. The sync streaming path had no tests at all — main exercises SSE only through the async client, so `SSEClient`, `GrowthBook.start_auto_refresh` and `_dispatch_sse_event` were uncovered. Adds 33 tests across three areas: - `SSEClient`: connect idempotency, URL building (including trailing-slash handling), custom header merging, and the disconnect paths — no loop/thread, joining, warning when the thread outlives the join, stopping the session only when the loop is running, and force-stopping on a future exception. - `GrowthBook.start_auto_refresh` / `_dispatch_sse_event`: delegation to the repository, the callback that gets wired up, the ValueError without a client_key, and each event type including an unknown one. - Serialization: bucket ranges as two-element arrays, namespaces as three-element arrays, the distinction between the two, round-tripping through features and raw JSON, and `Experiment.to_dict` scalar fields. 1041 tests pass.
vazarkevych
force-pushed
the
test/upgrade-test-coverage
branch
from
October 5, 2026 18:10
629d761 to
a29b610
Compare
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.
The sync streaming path had no test coverage. Main exercises SSE only through
the async client, so
SSEClient,GrowthBook.start_auto_refreshand_dispatch_sse_eventwere untested — a regression in any of them would havegone unnoticed.
Adds 33 tests across three areas:
SSEClient— connect idempotency, URL building (including trailing-slashhandling), custom header merging, and the disconnect paths: no loop/thread,
joining the thread, warning when it outlives the join, stopping the session only
when the loop is running, and force-stopping the loop on a future exception.
GrowthBook.start_auto_refresh/_dispatch_sse_event— delegation to therepository, the callback that gets wired up, the
ValueErrorraised without aclient_key, and each event type including an unknown one.Serialization — bucket ranges as two-element arrays, namespaces as
three-element arrays, the distinction between the two, round-tripping through
features and raw JSON, and
Experiment.to_dictscalar fields.Test-only: no source changes. The original branch also carried a fix for
multi-line
data:joining in_process_response, which main has since fixedindependently, so it's dropped here.
Rebuilt as a single commit on top of current main rather than merged — the old
branch had two merge commits and the stale source change tangled into the
conflicts.
1041 tests pass.