You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "Anshul-creator (via GitHub)" <gi...@apache.org> on 2025/12/11 19:00:05 UTC
[PR] Fix: Stabilize `dubbo-config-spring` reference-related tests by Disabling Metrics Initialization and Ensuring Test Isolation [dubbo]
Anshul-creator opened a new pull request, #15840:
URL: https://github.com/apache/dubbo/pull/15840
## What is the purpose of the change?
This PR stabilizes reference-related tests inside `dubbo-config-spring` that were intermittently failing under randomized execution orders (NonDex) due to shared Dubbo/Spring framework state leaking across test boundaries. The following tests were consistently among the flaky failures before this fix, but now pass reliably across all NonDex seeds:
- **LocalCallMultipleReferenceAnnotationsTest:** `testLocalCall`
- **LocalCallReferenceMixTest:** `testLocalCall`
- **LocalCallReferenceAnnotationTest:** `testLocalCall`
- **LocalCallTest:** `testLocalCall`
`LocalCallMultipleReferenceAnnotationsTest` also required tightening of the reference-bean assertions to avoid brittle assumptions about bean naming, while preserving the intended semantics of the test.
## Root Cause
These failures are identical to previously fixed issues in:
- https://github.com/apache/dubbo/pull/15778
- https://github.com/apache/dubbo/pull/15782
- https://github.com/apache/dubbo/pull/15785
Each of those PRs addressed flakiness caused by Micrometer’s `CompositeMeterRegistry`, which can throw an `ArrayIndexOutOfBoundsException` when it iterates over internal `IdentityHashMap` structures under randomized execution orders (NonDex).
The tests mentioned above suffered from the same underlying issue:
Dubbo framework state was leaking between test methods. This meant that the behavior of reference creation in one test could affect subsequent tests, causing nondeterministic failures.
## Changes Made
To fully isolate each test method and eliminate shared state, the following changes were applied:
- 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.
- Updated the assertions in `LocalCallMultipleReferenceAnnotationsTest` to account for valid variation in reference-bean naming, while still enforcing the correct reference-sharing behavior.
## Verification
You can try running the following snippet of code from the dubbo repo root, on both pre-fix and post-fix code
```bash
./mvnw -q -pl dubbo-config/dubbo-config-spring \
edu.illinois:nondex-maven-plugin:2.2.1:nondex \
-DnondexRuns=50
```
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-spring/.nondex` directory.
## Checklist
- [x] Make sure there is a [GitHub_issue](https://github.com/apache/dubbo/issues) field for the change.
- [x] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- [x] 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](https://github.com/apache/dubbo-samples) project.
- [x] Make sure gitHub actions can pass. [Why the workflow is failing and how to fix it?](../CONTRIBUTING.md)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] Fix: Stabilize `dubbo-config-spring` reference-related tests by Disabling Metrics Initialization and Ensuring Test Isolation [dubbo]
Posted by "codecov-commenter (via GitHub)" <gi...@apache.org>.
codecov-commenter commented on PR #15840:
URL: https://github.com/apache/dubbo/pull/15840#issuecomment-3643450768
## [Codecov](https://app.codecov.io/gh/apache/dubbo/pull/15840?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 35.34%. Comparing base ([`4a119ca`](https://app.codecov.io/gh/apache/dubbo/commit/4a119cab1c414aef891b3bd65a84f907633eb9d2?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`da2e3ad`](https://app.codecov.io/gh/apache/dubbo/commit/da2e3ad01dc0903fc0bc4d535d3707e9796ddef1?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
:warning: Report is 1 commits behind head on 3.3.
> :exclamation: There is a different number of reports uploaded between BASE (4a119ca) and HEAD (da2e3ad). Click for more details.
>
> <details><summary>HEAD has 7 uploads less than BASE</summary>
>
>| Flag | BASE (4a119ca) | HEAD (da2e3ad) |
>|------|------|------|
>|samples-tests-java21|1|0|
>|integration-tests-java8|1|0|
>|unit-tests-java17|1|0|
>|unit-tests-java8|1|0|
>|unit-tests-java25|1|0|
>|unit-tests-java11|1|0|
>|unit-tests-java21|1|0|
></details>
<details><summary>Additional details and impacted files</summary>
```diff
@@ Coverage Diff @@
## 3.3 #15840 +/- ##
=============================================
- Coverage 60.75% 35.34% -25.41%
+ Complexity 11713 11103 -610
=============================================
Files 1938 1937 -1
Lines 88688 88670 -18
Branches 13387 13303 -84
=============================================
- Hits 53882 31344 -22538
- Misses 29271 52813 +23542
+ Partials 5535 4513 -1022
```
| [Flag](https://app.codecov.io/gh/apache/dubbo/pull/15840/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
|---|---|---|
| [integration-tests-java21](https://app.codecov.io/gh/apache/dubbo/pull/15840/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `32.37% <ø> (+<0.01%)` | :arrow_up: |
| [integration-tests-java8](https://app.codecov.io/gh/apache/dubbo/pull/15840/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [samples-tests-java21](https://app.codecov.io/gh/apache/dubbo/pull/15840/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [samples-tests-java8](https://app.codecov.io/gh/apache/dubbo/pull/15840/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `29.72% <ø> (+0.03%)` | :arrow_up: |
| [unit-tests-java11](https://app.codecov.io/gh/apache/dubbo/pull/15840/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [unit-tests-java17](https://app.codecov.io/gh/apache/dubbo/pull/15840/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [unit-tests-java21](https://app.codecov.io/gh/apache/dubbo/pull/15840/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [unit-tests-java25](https://app.codecov.io/gh/apache/dubbo/pull/15840/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
| [unit-tests-java8](https://app.codecov.io/gh/apache/dubbo/pull/15840/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
</details>
[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/apache/dubbo/pull/15840?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
<details><summary> :rocket: New features to boost your workflow: </summary>
- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
- :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org
Re: [PR] Fix: Stabilize more `dubbo-config-spring` reference-related tests by Disabling Metrics Initialization and Ensuring Test Isolation [dubbo]
Posted by "RainYuY (via GitHub)" <gi...@apache.org>.
RainYuY merged PR #15840:
URL: https://github.com/apache/dubbo/pull/15840
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org