Skip to content

Fix: Stabilize ApplicationConfigTest by Disabling Metrics Initialization and Ensuring Test Isolation - #15791

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

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

Conversation

@Anshul-creator

Copy link
Copy Markdown
Contributor

What is the purpose of the change?

This PR stabilizes several tests in ApplicationConfigTest that were intermittently failing under randomized execution orders (NonDex):

  • testOverrideEmptyConfig
  • testOverrideConfigById
  • testOverrideConfigByName
  • testLoadConfig
  • testOverrideConfigConvertCase
  • testDefaultValue

All of these tests trigger DubboBootstrap.initialize() which unintentionally initializes the metrics subsystem. Since these tests do not depend on metrics, metrics initialization introduces nondeterministic failures unrelated to application configuration logic.

Root Cause

These failures are identical to previously fixed issues in:

Those PRs addressed flakiness caused by Micrometer’s CompositeMeterRegistry being initialized during DubboBootstrap.initialize(), which, under certain NonDex randomized execution orders, can throw an ArrayIndexOutOfBoundsException from an internal IdentityHashMap iterator.

ApplicationConfigTest suffers from the same root cause, and the same fix resolves the issue.

Changes Made

  • Disabled the metrics subsystem at the beginning of each test.
  • Cleared all system properties via SysProps.clear() in the lifecycle hooks to avoid cross-test pollution.
  • Reset framework state using DubboBootstrap.reset() to ensure isolation between tests.

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 22, 2025 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.78%. Comparing base (9b32dc1) to head (33e9334).
⚠️ Report is 210 commits behind head on 3.3.

Additional details and impacted files
@@             Coverage Diff              @@
##                3.3   #15791      +/-   ##
============================================
+ Coverage     60.76%   60.78%   +0.02%     
+ Complexity    11698    11690       -8     
============================================
  Files          1938     1938              
  Lines         88646    88646              
  Branches      13379    13379              
============================================
+ Hits          53868    53886      +18     
+ Misses        29250    29237      -13     
+ Partials       5528     5523       -5     
Flag Coverage Δ
integration-tests-java21 32.37% <ø> (+<0.01%) ⬆️
integration-tests-java8 32.44% <ø> (+<0.01%) ⬆️
samples-tests-java21 32.07% <ø> (+0.01%) ⬆️
samples-tests-java8 29.70% <ø> (+<0.01%) ⬆️
unit-tests-java11 59.09% <ø> (+0.01%) ⬆️
unit-tests-java17 58.55% <ø> (+<0.01%) ⬆️
unit-tests-java21 58.56% <ø> (-0.01%) ⬇️
unit-tests-java25 58.51% <ø> (-0.02%) ⬇️
unit-tests-java8 59.08% <ø> (+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 merged commit a779fde into apache:3.3 Nov 26, 2025
@Anshul-creator
Anshul-creator deleted the fix-ApplicationConfigTest branch November 27, 2025 06:11
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