Skip to content

test: allow 200 empty batch with tail on at-tail unary reads - #166

Merged
shikhar merged 1 commit into
mainfrom
test/allow-unary-tail-200
Dec 4, 2026
Merged

shikhar merged 1 commit into
mainfrom
test/allow-unary-tail-200

Conversation

@shikhar

@shikhar shikhar commented Dec 4, 2026

Copy link
Copy Markdown
Member

Prepare integration tests for unifying 416 Range Not Satisfiable semantics across unary and streaming reads (s2-streamstore/s2#316).

At-tail unary wait = 0 reads (empty stream, clamp=true beyond tail, auto-create on read) will return 200 with an empty batch and tail populated instead of 416. Accept either 200 empty+tail or 416 during rollout so both s2-lite and s2-cloud CI pass; strictly beyond-tail reads without clamp continue asserting 416.

@greptile-apps

greptile-apps Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Confidence Score: 5/5RetriggerView in Greptile

[Low impact] The PR appears safe to merge.

Summary

Updates integration tests to accept both server behaviors for unary reads at the tail.

  • Unary-read tests accept both server responses when a read starts at the tail.

No actionable issues found. Review used source inspection; integration tests were not run.

Reviews (1) · Last reviewed commit: "test: allow 200 empty batch with tail on..." · Reviewed by Greptile

@shikhar
shikhar merged commit 0a2c628 into main Dec 4, 2026
6 checks passed
shikhar added a commit to s2-streamstore/s2 that referenced this pull request Dec 5, 2026
…=0 at tail (#971)

Unify `416 Range Not Satisfiable` semantics across single-batch and
streaming reads. Fixes #316.

- Return `416` only when the requested starting position is strictly
beyond the tail without `clamp` (`seq_num > tail.seq_num` or `timestamp
> tail.timestamp`).
- Return `200` with `{ records: [], tail: Some(tail) }` when an in-range
or clamped single-batch `wait = 0` read reaches the tail with no records
(empty stream, `seq_num == tail`, `tail_offset = 0`, clamped start, or
fully trimmed stream), simplifying `merge_read_session` to rely on
`read_session` for stop conditions.
- Pre-tail `count`/`bytes`/`until` cutoffs continue returning `200 {
records: [], tail: None }`.
- Update OpenAPI annotations (`s2-api`, `s2-lite`), SDK rustdocs
(`s2-sdk`), `s2-lite` read tests, and `s2-sdk` tests (rollout-safe on
`stream_ops.rs` until `s2-cloud` deploys).

Related PRs:
- s2-streamstore/s2-sdk-python#166 (merged)
- s2-streamstore/s2-sdk-typescript#450 (merged)
- s2-streamstore/s2-sdk-go#536 (merged)
- s2-streamstore/s2-cloud#2082
- s2-streamstore/s2-specs#67
- s2-streamstore/docs#408
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.

1 participant