Skip to content

Fix: Stabilize ExporterSideConfigUrlTest by disabling metrics initialization during URL export - #15778

Merged
RainYuY merged 1 commit into
apache:3.3from
Anshul-creator:fix-ExporterSideConfigUrlTest
Nov 20, 2025
Merged

RainYuY merged 1 commit into
apache:3.3from
Anshul-creator:fix-ExporterSideConfigUrlTest

Conversation

@Anshul-creator

@Anshul-creator Anshul-creator commented Nov 19, 2025 •

Copy link
Copy Markdown
Contributor

What is the purpose of the change?

This PR stabilizes the following three tests in ExporterSideConfigUrlTest:

  • exporterMethodConfigUrlTest
  • exporterServiceConfigUrlTest
  • exporterProviderConfigUrlTest

These tests were intermittently failing under randomized execution orders due to nondeterministic behavior in Micrometer’s composite meter registry, which was being initialized during Dubbo’s metrics setup, even though these URL-related tests do not depend on metrics.

Root Cause

When servConf.export() is invoked inside verifyExporterUrlGeneration, Dubbo triggers DefaultApplicationDeployer.initialize(), which initializes metrics reporters (Prometheus by default).
During this initialization, Micrometer’s CompositeMeterRegistry iterates through an internal IdentityHashMap whose iteration order is not deterministic under randomized JVM execution orders.

Under certain NonDex seeds, this produces:

java.lang.ArrayIndexOutOfBoundsException
  at java.util.IdentityHashMap$KeyIterator.next(...)
  at io.micrometer.core.instrument.composite.CompositeMeterRegistry.updateDescendants(...)

This exception happens before the test even begins validating URL parameters, making the failure unrelated to URL behavior.
The test suite never intended to validate metrics behavior here, so metrics initialization adds unnecessary non-determinism.

Changes Made

  • Added explicit test-local configuration to disable the metrics subsystem for every test execution in this class
  • Ensured cleanup via SysProps.clear() in both @BeforeEach and @AfterEach to preserve isolation.
  • Preserved the existing test structure and behavior.

Verification

You can try running the following snippet of code from the dubbo repo root, on both pre-fix and post-fix code

./mvnw -q -pl dubbo-config/dubbo-config-api \
  edu.illinois:nondex-maven-plugin:2.2.1:nondex \
  -DnondexRuns=20

The tests should fail intermittently on the pre-fix version, but pass consistently across all seeds on the post-fix version.
NonDex run logs will be available under the dubbo-config/dubbo-config-api/.nondex directory.

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 your logic correction. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
  • Make sure gitHub actions can pass. Why the workflow is failing and how to fix it?

@codecov-commenter

codecov-commenter commented Nov 19, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.84%. Comparing base (58d7386) to head (2d24327).

Additional details and impacted files
@@             Coverage Diff              @@
##                3.3   #15778      +/-   ##
============================================
- Coverage     60.77%   58.84%   -1.94%     
+ Complexity    11706       15   -11691     
============================================
  Files          1938     1938              
  Lines         88646    88646              
  Branches      13379    13380       +1     
============================================
- Hits          53875    52160    -1715     
- Misses        29249    30832    +1583     
- Partials       5522     5654     +132     
Flag Coverage Δ
integration-tests-java21 ?
integration-tests-java8 ?
samples-tests-java21 ?
samples-tests-java8 ?
unit-tests-java11 59.09% <ø> (-0.01%) ⬇️
unit-tests-java17 58.55% <ø> (-0.01%) ⬇️
unit-tests-java21 58.54% <ø> (+0.01%) ⬆️
unit-tests-java25 58.52% <ø> (+0.02%) ⬆️
unit-tests-java8 59.09% <ø> (+0.01%) ⬆️

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.

@zrlw zrlw 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

@RainYuY RainYuY left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM

@RainYuY
RainYuY merged commit 1747f99 into apache:3.3 Nov 20, 2025
@Anshul-creator
Anshul-creator deleted the fix-ExporterSideConfigUrlTest branch November 21, 2025 18:49
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