Skip to content

test(sdk): validate handle_response status and length edge cases - #3202

Merged
hubcio merged 4 commits into
apache:masterfrom
ankushT369:unit_test_tcp_client
May 14, 2026
Merged

hubcio merged 4 commits into
apache:masterfrom
ankushT369:unit_test_tcp_client

Conversation

@ankushT369

@ankushT369 ankushT369 commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor

Rationale

Tests for handle_response did not cover important edge cases around status codes and response length, leaving potential failure scenarios unverified.

What changed?

handle_response behavior was not validated for error conditions such as non-zero status codes or when the declared response length exceeds available data.

Added unit tests covering both success and failure paths, including boundary conditions for status and length handling.

AI Usage

None

@ankushT369

Copy link
Copy Markdown
Contributor Author

@hubcio Hi can you please review this ?

@codecov

codecov Bot commented Apr 30, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.96%. Comparing base (d2e2606) to head (562a380).

Additional details and impacted files
@@              Coverage Diff              @@
##             master    #3202       +/-   ##
=============================================
- Coverage     73.84%   58.96%   -14.89%     
  Complexity      943      943               
=============================================
  Files          1193     1192        -1     
  Lines        108933    98419    -10514     
  Branches      85949    75452    -10497     
=============================================
- Hits          80444    58033    -22411     
- Misses        25758    37770    +12012     
+ Partials       2731     2616      -115     
Components Coverage Δ
Rust Core 55.40% <100.00%> (-19.48%) ⬇️
Java SDK 60.14% <ø> (ø)
C# SDK 69.13% <ø> (-0.31%) ⬇️
Python SDK 81.43% <ø> (ø)
Node SDK 91.44% <ø> (-0.09%) ⬇️
Go SDK 39.80% <ø> (ø)
Files with missing lines Coverage Δ
core/sdk/src/tcp/tcp_client.rs 73.44% <100.00%> (+1.99%) ⬆️

... and 256 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread core/sdk/src/tcp/tcp_client.rs
Add tests to ensure handle_response returns errors for non-zero status
codes and when declared length exceeds available data. Also verify
successful responses for valid status and bounded lengths.

test(sdk): validate handle_response status and length edge cases
@ankushT369

ankushT369 commented Apr 30, 2026 •

Copy link
Copy Markdown
Contributor Author

@hubcio Hey I didnt get the Check status failing in the previous commit

@ankushT369 ankushT369 changed the title test(client): validate handle_response status and length edge cases test(sdk): validate handle_response status and length edge cases May 2, 2026
@hubcio
hubcio merged commit 62fb33a into apache:master May 14, 2026
80 checks passed
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.

4 participants