Clear shared state pollution to avoid flaky tests in class ExtensionL… #8467
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.
Link to issue: #8453
What is the purpose of the change
This PR is to fix 2 flaky tests
org.apache.dubbo.common.extension.ExtensionLoaderTest.test_AddExtension_Adaptive
and
org.apache.dubbo.common.extension.ExtensionLoaderTest.test_AddExtension_NoExtend
ExtensionLoader
after running, which pollutes the state shared among tests and can lead toIllegalStateException
.Brief changelog
ExtensionLoader
when the tests end.Verifying this change
With the proposed fix, the tests do not pollute the shared state (and pass when multiple tests that use this state are run in the same JVM).
Checklist