Skip to content

feat: port client-side streaming retry contract tests to v3 - #475

Merged
keelerm84 merged 1 commit into
v3from
mk/SDK-3211/port-stream-retry
Sep 28, 2026
Merged

keelerm84 merged 1 commit into
v3from
mk/SDK-3211/port-stream-retry

Conversation

@keelerm84

@keelerm84 keelerm84 commented Sep 28, 2026 •

Copy link
Copy Markdown
Member

Forward-ports v2 #395 (client-side streaming retry and error-recovery contract tests) to v3. SDK-3211.

Mapping to v3

v3 has no FDv1 streaming data source, so the tests run against the FDv2 streaming synchronizer. This is the same mapping v3 already uses for the server-side retry tests in server_side_stream_retry.go. The stream endpoint is the SDK's only synchronizer, with no polling initializer (as in CommonStreamingTests.setupDataSystems). The flag key is flag-key because v3's makeSDKDataWithFlag fixes it. Timeouts and client-event-source-http-errors gating are unchanged. v3 already had that capability and its docs, so neither is duplicated.

Case-by-case check against FDv2 semantics

Every #395 case was ported. None of them expects a retry after an error that FDv2 treats as permanent, so no assertion needed to change.

Case FDv2 behavior Status
retry after stream is closed synchronizer reconnects ported as-is
retry after IO error on initial connect / reconnect recoverable, same synchronizer retries ported as-is
retry after recoverable HTTP error (400, 408, 429, 500, 503) on initial connect / reconnect recoverable, same synchronizer retries ported as-is
do not retry after unrecoverable HTTP error (401, 403, 405) on initial connect / reconnect permanent: synchronizer is removed; with no other synchronizer configured, the endpoint gets no further connections ported as-is. Fallback to a secondary synchronizer is already covered by "permanent fallback to secondary synchronizer" in common_tests_stream_fdv2.go.

One adaptation: in v2, the initial-connect tests had JS SDKs poll for dataV1 first, and dataV2 on the stream proved that the data came from the stream. On v3 there is no polling initializer, so the SDK starts with no flags. Seeing dataV2 still proves the data came from the stream.

Not ported: v2 #404

#404 (RETRY-conformance tests and the retry-conformance-fdv1-streaming / retry-conformance-fdv1-polling capabilities) is intentionally not ported: no tests, no capability constants, no docs, no gating. It targets FDv1 data-source code paths, which don't exist in v3. Its v3 predecessor #401 was closed for that reason. Advertising the capabilities with no tests behind them would be misleading.

Verification

  • go build ./..., go vet ./..., go test ./...: pass
  • make lint (golangci-lint v2.11.1): 0 issues
  • Not yet run against a real client-side SDK test service.

Note

Overview
Adds a retry behavior sub-suite to client-side streaming tests by wiring doClientSideStreamRetryTests into doClientSideStreamTests and introducing client_side_stream_retry.go.

The new contract tests exercise FDv2 streaming as the only data synchronizer (no polling initializer): reconnect after a closed stream; retries after I/O or recoverable HTTP statuses (400, 408, 429, 500, 503) on first connect and on reconnect, with InitCanFail where client SDKs may finish init before background retries succeed; and no further connections after unrecoverable statuses (401, 403, 405) when client-event-source-http-errors is advertised. Mock endpoints use sequential handlers and connection counting, with client-appropriate timeouts.

Reviewed by Cursor Bugbot for commit 861b1d0. Bugbot is set up for automated code reviews on this repo. Configure here.

…ts (#395)

Forward-port of v2 #395 to v3. On v3 the tests run against the FDv2
streaming synchronizer, following the same mapping v3 already uses for
the server-side retry tests. JS-based SDKs no longer get initial data
from a polling data source; the stream is the only data source.

The client-event-source-http-errors capability already exists on v3, so
only the tests and their registration are added.

(cherry picked from commit 5e512a0)

SDK-3211
@keelerm84
keelerm84 marked this pull request as ready for review September 28, 2026 16:11
@keelerm84
keelerm84 requested a review from a team as a code owner September 28, 2026 16:11

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 861b1d0. Configure here.


// Check that the client got the new data from the second stream
pollUntilFlagValueUpdated(t, client, flagKey, context, expectedValueV1, expectedValueV2, ldvalue.Null())
})

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Roku handshake breaks retry sequencing

Medium Severity

These retry cases drive a SequentialHandler and treat every request to the mock streaming endpoint as one stream attempt. Roku still sends a short-lived POST /handshake before the SSE connection, so that extra request consumes a handler slot and shifts later responses. Nearby connection-lifecycle coverage already skips this handshake.

Additional Locations (2)
Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit 861b1d0. Configure here.

@keelerm84
keelerm84 merged commit f968442 into v3 Sep 28, 2026
9 checks passed
@keelerm84
keelerm84 deleted the mk/SDK-3211/port-stream-retry branch September 28, 2026 16:52
joker23 pushed a commit that referenced this pull request Oct 8, 2026
🤖 I have created a release *beep* *boop*
---


##
[3.2.0-alpha.11](v3.2.0-alpha.10...v3.2.0-alpha.11)
(2026-10-08)


### Features

* adding client side bootstrap tests
([#462](#462))
([9c1810d](9c1810d))
* Port client-side prerequisite cycle detection tests to v3
([#473](#473))
([7e65a58](7e65a58))
* port client-side streaming retry contract tests to v3
([#475](#475))
([f968442](f968442))


### Bug Fixes

* Verify all-items reads for empty and single-item collections
([#466](#466))
([489a780](489a780))
* Verify SDKs read all three persistent-store tombstone shapes
([#484](#484))
([a9a0696](a9a0696))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Overview**
> **Release 3.2.0-alpha.11** — automated version bump only:
`.release-please-manifest.json`, `versionString` in `main.go`, and a new
`CHANGELOG.md` section.
> 
> The changelog documents what ships in this alpha: **new contract
coverage** for client-side bootstrap, prerequisite cycle detection
(ported to v3), and streaming retry behavior; plus **harness fixes** for
all-items reads on empty/single-item persistent-store collections and
for all three persistent-store tombstone shapes.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
1a2073d. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants