Skip to content

[PR] #15935 Enhance NetUtils IPv6 handling and test coverage#15974

Merged
EarthChen merged 2 commits intoapache:3.3from
krrishmahar:fix/netutils-ipv6-tests-15935
Jan 7, 2026
Merged

[PR] #15935 Enhance NetUtils IPv6 handling and test coverage#15974
EarthChen merged 2 commits intoapache:3.3from
krrishmahar:fix/netutils-ipv6-tests-15935

Conversation

@krrishmahar
Copy link
Contributor

What is the purpose of the change?

This PR addresses issue #15935 by improving IPv6-related test coverage in NetUtils.

Specifically, it:

  • Adds unit tests for IPv6 address normalization without scope.
  • Verifies IPv6 CIDR matching behavior in matchIpExpression.
  • Ensures unsupported IPv6 wildcard patterns fail fast with clear exceptions.
  • Validates mismatched IPv4 pattern and IPv6 host scenarios.
  • Documents current implementation-defined behavior via tests, without modifying runtime logic.

No functional behavior is changed; this PR focuses on correctness, clarity, and maintainability through testing.

Brief changelog

  • NetUtilsTest.java
    • Added IPv6 normalization tests.
    • Added IPv6 CIDR and invalid pattern matching tests.
    • Added validation for IPv4/IPv6 mismatch cases.
    • Documented unsupported IPv6 wildcard behavior.

Verifying this change

Validated locally by running:

mvn test -Dtest=NetUtilsTest -pl dubbo-common

And verify build by running:

./mvnw -e --batch-mode --no-snapshot-updates --no-transfer-progress --fail-fast clean install -Psources,skip-spotless,checkstyle -Dmaven.test.skip=true

Checklist

  • Make sure there is a GitHub_issue field for the change.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Write necessary unit-test to verify behavior. No production logic is changed.
  • Make sure GitHub Actions can pass.

@krrishmahar krrishmahar force-pushed the fix/netutils-ipv6-tests-15935 branch from dbb6757 to ac4781f Compare January 6, 2026 15:03
@codecov-commenter
Copy link

codecov-commenter commented Jan 6, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.69%. Comparing base (56924bb) to head (ac4781f).

Additional details and impacted files
@@             Coverage Diff              @@
##                3.3   #15974      +/-   ##
============================================
- Coverage     60.69%   60.69%   -0.01%     
- Complexity    11706    11709       +3     
============================================
  Files          1946     1946              
  Lines         88701    88701              
  Branches      13374    13374              
============================================
- Hits          53838    53837       -1     
- Misses        29353    29354       +1     
  Partials       5510     5510              
Flag Coverage Δ
integration-tests-java21 32.20% <ø> (-0.06%) ⬇️
integration-tests-java8 32.32% <ø> (-0.08%) ⬇️
samples-tests-java21 32.10% <ø> (-0.03%) ⬇️
samples-tests-java8 29.69% <ø> (+0.03%) ⬆️
unit-tests-java11 58.97% <ø> (-0.01%) ⬇️
unit-tests-java17 58.46% <ø> (-0.04%) ⬇️
unit-tests-java21 58.46% <ø> (-0.01%) ⬇️
unit-tests-java25 58.42% <ø> (-0.02%) ⬇️
unit-tests-java8 58.98% <ø> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member

@RainYuY RainYuY left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Member

@EarthChen EarthChen left a comment

Choose a reason for hiding this comment

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

LGTM

@EarthChen EarthChen merged commit bc09177 into apache:3.3 Jan 7, 2026
33 checks passed
@krrishmahar krrishmahar deleted the fix/netutils-ipv6-tests-15935 branch January 7, 2026 07:37
ishankhemani pushed a commit to ishankhemani/dubbo that referenced this pull request Jan 8, 2026
…pache#15974)

* test: clarify unsupported IPv6 behavior in NetUtils

* test: added IPV6 edgecase, fixed ambigious CIDR testcase
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants