test: remove external network dependency from HttpClientUtilTest#8099
Merged
funky-eyes merged 4 commits intoMay 14, 2026
Merged
Conversation
Signed-off-by: Vinod Kumar <codingkiddo@gmail.com>
Codecov Report✅ All modified and coverable lines are covered by tests. 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 🚀 New features to boost your workflow:
|
funky-eyes
reviewed
May 12, 2026
funky-eyes
left a comment
Contributor
There was a problem hiding this comment.
Please register your PR in those two files :
https://github.com/apache/incubator-seata/blob/2.x/changes/zh-cn/2.x.md
https://github.com/apache/incubator-seata/blob/2.x/changes/en-us/2.x.md
Signed-off-by: Vinod Kumar <codingkiddo@gmail.com>
b3576a9 to
a90ad23
Compare
Contributor
Author
|
Done, I’ve registered PR #8099 in both |
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 |
Contributor
Author
|
Thank you for the review! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What changed
Replaced the external HTTP calls in
HttpClientUtilTest#testHttpSendReswith a local in-process HTTP server bound to127.0.0.1on 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
HttpClientUtilGET and POST request paths.Validation
./mvnw -pl common clean test -Dtest=HttpClientUtilTest#testHttpSendRes Tests run: 1, Failures: 0, Errors: 0, Skipped: 0 BUILD SUCCESS