[Dubbo-6954] Reset ExtensionLoader in ExtensionLoaderTest#6953
Merged
AlbumenJ merged 1 commit intoapache:masterfrom Apr 12, 2021
Merged
[Dubbo-6954] Reset ExtensionLoader in ExtensionLoaderTest#6953AlbumenJ merged 1 commit intoapache:masterfrom
AlbumenJ merged 1 commit intoapache:masterfrom
Conversation
Codecov Report
@@ Coverage Diff @@
## master #6953 +/- ##
============================================
+ Coverage 59.13% 59.35% +0.21%
+ Complexity 509 507 -2
============================================
Files 1028 1028
Lines 41519 41519
Branches 6037 6037
============================================
+ Hits 24554 24642 +88
+ Misses 14197 14128 -69
+ Partials 2768 2749 -19 Continue to review full report at Codecov.
|
Member
|
lgtm, thanks for your contribution to make unit test more strength. |
Author
|
@AlbumenJ Thanks for the review! Is there anything I can do on my end for this to be merged? |
AlbumenJ
added a commit
to AlbumenJ/dubbo
that referenced
this pull request
May 28, 2021
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 is the purpose of the change
The tests are not idempotent and fails if run twice in the same JVM, because each of the tests pollutes state shared among tests:
dubbo-common,org.apache.dubbo.common.extension.ExtensionLoaderTest.test_replaceExtension_Adaptivedubbo-common,org.apache.dubbo.common.extension.ExtensionLoaderTest.test_AddExtensiondubbo-common,org.apache.dubbo.common.extension.ExtensionLoaderTest.test_replaceExtensionIt may be good to clean this state pollution so that some other tests do not fail in the future due to the shared state polluted by these tests.
Brief changelog
Call
ExtensionLoader.resetExtensionLoader()to reset the ExtensionLoader for the certain extension types used in each tests intest_replaceExtension_Adaptive,test_AddExtension, andtest_replaceExtension.Verifying this change
With the proposed fix, the test does not pollute the shared state (and passes when run twice in the same JVM).
Link to issue: #6954