Skip to content

test: remove external network dependency from HttpClientUtilTest#8099

Merged
funky-eyes merged 4 commits into
apache:2.xfrom
codingkiddo:test/remove-httpclient-external-network-dependency
May 14, 2026
Merged

test: remove external network dependency from HttpClientUtilTest#8099
funky-eyes merged 4 commits into
apache:2.xfrom
codingkiddo:test/remove-httpclient-external-network-dependency

Conversation

@codingkiddo

Copy link
Copy Markdown
Contributor

What changed

Replaced the external HTTP calls in HttpClientUtilTest#testHttpSendRes with a local in-process HTTP server bound to 127.0.0.1 on a random port.

Why

The previous test depended on an external network endpoint, which could make the unit test flaky in local or CI environments when DNS, proxy, firewall, or network connectivity is unavailable or slow.

Using a local HTTP server keeps the test deterministic while still exercising the existing HttpClientUtil GET and POST request paths.

Validation

./mvnw -pl common clean test -Dtest=HttpClientUtilTest#testHttpSendRes

Tests run: 1, Failures: 0, Errors: 0, Skipped: 0
BUILD SUCCESS

Signed-off-by: Vinod Kumar <codingkiddo@gmail.com>
@funky-eyes funky-eyes added this to the 2.7.0 milestone May 12, 2026
@funky-eyes funky-eyes added first-time contributor first-time contributor type: test test case labels May 12, 2026
@codecov

codecov Bot commented May 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 72.10%. Comparing base (40691a6) to head (b3576a9).

Additional details and impacted files
@@             Coverage Diff              @@
##                2.x    #8099      +/-   ##
============================================
- Coverage     72.11%   72.10%   -0.02%     
  Complexity      916      916              
============================================
  Files          1325     1325              
  Lines         50826    50826              
  Branches       6085     6085              
============================================
- Hits          36654    36647       -7     
- Misses        11148    11152       +4     
- Partials       3024     3027       +3     

see 9 files with indirect coverage changes

Impacted file tree graph

🚀 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.

@funky-eyes funky-eyes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Signed-off-by: Vinod Kumar <codingkiddo@gmail.com>
@codingkiddo codingkiddo force-pushed the test/remove-httpclient-external-network-dependency branch from b3576a9 to a90ad23 Compare May 12, 2026 07:25
@codingkiddo

Copy link
Copy Markdown
Contributor Author

Done, I’ve registered PR #8099 in both changes/zh-cn/2.x.md and changes/en-us/2.x.md. Thank you!

@funky-eyes funky-eyes left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@funky-eyes

Copy link
Copy Markdown
Contributor

If you're using the DingTalk app, please send your DingTalk account to my email at jianbin@apache.org, and I will invite you to join the Seata developer group

@codingkiddo

Copy link
Copy Markdown
Contributor Author

Thank you for the review!

@funky-eyes funky-eyes merged commit 93ec4e0 into apache:2.x May 14, 2026
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

first-time contributor first-time contributor type: test test case

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants