Skip to content

fix(storage): add unit tests for ReadRange bounded and unbounded completions - #16419

Merged
kalragauri merged 4 commits into
googleapis:mainfrom
kalragauri:feat/bidi-read-range
Sep 10, 2026
Merged

kalragauri merged 4 commits into
googleapis:mainfrom
kalragauri:feat/bidi-read-range

Conversation

@kalragauri

@kalragauri kalragauri commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

This PR adds unit tests for ReadRange to verify range completion semantics under various server response patterns:

  • Single-chunk bounded read: Verifies that a bounded range read (ReadRange(offset, length) where length > 0) auto-completes immediately when all requested bytes arrive, even if the server's response sets range_end: false.
  • Multi-chunk bounded read: Verifies that a bounded read spanning multiple chunks only completes once the cumulative received bytes satisfy the full requested length.
  • Unbounded read: Verifies that an unbounded read (ReadRange(offset, std::nullopt)) remains open across incoming chunks until the server explicitly signals range_end: true.

@product-auto-label product-auto-label Bot added the api: storage Issues related to the Cloud Storage API. label Sep 8, 2026

@gemini-code-assist gemini-code-assist 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.

Code Review

This pull request updates ReadRange::OnRead to automatically mark range_end as true when the remaining requested length of a bounded read reaches zero. This allows the range to complete immediately without waiting for an additional empty end-of-range message from the server. Corresponding unit tests have been added to verify this behavior for single-chunk bounded reads, multi-chunk bounded reads, and unbounded reads. There are no review comments, and I have no feedback to provide.

@kalragauri
kalragauri marked this pull request as ready for review September 8, 2026 09:44
@kalragauri
kalragauri requested review from a team as code owners September 8, 2026 09:44
@codecov

codecov Bot commented Sep 8, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.28%. Comparing base (747973a) to head (7e8ebf7).

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #16419   +/-   ##
=======================================
  Coverage   92.28%   92.28%           
=======================================
  Files        2246     2246           
  Lines      212663   212734   +71     
=======================================
+ Hits       196247   196322   +75     
+ Misses      16416    16412    -4     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@kalragauri kalragauri changed the title fix(storage): auto-complete bounded BiDi read ranges upon receiving all requested bytes fix(storage): add unit tests for ReadRange bounded and unbounded completions Sep 9, 2026
@kalragauri
kalragauri merged commit 4d385e8 into googleapis:main Sep 10, 2026
66 checks passed
@kalragauri
kalragauri deleted the feat/bidi-read-range branch September 10, 2026 11:11

This branch was previously deployed

1 inactive deployment
false — 7e8ebf7b Deployed Sep 10, 2026 by kalragauri via Save PR ref #11617
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: storage Issues related to the Cloud Storage API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

⌂ 换网址