Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clear shared state pollution to avoid flaky tests in class ExtensionL… #8467

Merged
merged 1 commit into from
Aug 11, 2021

Conversation

LALAYANG
Copy link
Contributor

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

  • The 2 tests do not reset ExtensionLoader after running, which pollutes the state shared among tests and can lead to IllegalStateException.
  • It may be better to clean state pollutions so that some other tests won't fail in the future due to the shared state pollution.

Brief changelog

  • Reset 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

  • Make sure there is a GitHub_issue field for the change (usually before you start working on it). Trivial changes like typos do not require a GitHub issue. Your pull request should address just this issue, without pulling in other changes - one PR resolves one issue.
  • Each commit in the pull request should have a meaningful subject line and body.
  • Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
  • Check if is necessary to patch to Dubbo 3 if you are work on Dubbo 2.7
  • Write necessary unit-test to verify your logic correction, more mock a little better when cross module dependency exist. If the new feature or significant change is committed, please remember to add sample in dubbo samples project.
  • Add some description to dubbo-website project if you are requesting to add a feature.
  • GitHub Actions works fine on your own branch.
  • If this contribution is large, please follow the Software Donation Guide.

@codecov-commenter
Copy link

codecov-commenter commented Aug 11, 2021

Codecov Report

Merging #8467 (0ccc85c) into 3.0 (1c25aa3) will decrease coverage by 0.17%.
The diff coverage is n/a.

Impacted file tree graph

@@             Coverage Diff              @@
##                3.0    #8467      +/-   ##
============================================
- Coverage     63.23%   63.06%   -0.18%     
- Complexity      311      312       +1     
============================================
  Files          1104     1111       +7     
  Lines         46258    46484     +226     
  Branches       6977     7001      +24     
============================================
+ Hits          29252    29313      +61     
- Misses        13733    13906     +173     
+ Partials       3273     3265       -8     
Impacted Files Coverage Δ
...ing/context/DubboBootstrapApplicationListener.java 60.00% <0.00%> (-22.00%) ⬇️
...g/context/DubboInfraBeanRegisterPostProcessor.java 93.33% <0.00%> (-6.67%) ⬇️
.../threadpool/manager/DefaultExecutorRepository.java 70.54% <0.00%> (-5.79%) ⬇️
...ory/annotation/ServiceAnnotationPostProcessor.java 77.45% <0.00%> (-4.70%) ⬇️
.../report/support/AbstractMetadataReportFactory.java 73.33% <0.00%> (-3.59%) ⬇️
.../config/spring/reference/ReferenceBeanSupport.java 91.53% <0.00%> (-2.87%) ⬇️
...java/org/apache/dubbo/remoting/api/Connection.java 75.25% <0.00%> (-2.07%) ⬇️
...notation/ReferenceAnnotationBeanPostProcessor.java 87.80% <0.00%> (-2.05%) ⬇️
...org/apache/dubbo/common/utils/AnnotationUtils.java 83.49% <0.00%> (-1.51%) ⬇️
...onfig/spring/schema/DubboBeanDefinitionParser.java 79.84% <0.00%> (-0.85%) ⬇️
... and 24 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 1c25aa3...0ccc85c. Read the comment docs.

@AlbumenJ AlbumenJ merged commit b64ea1d into apache:3.0 Aug 11, 2021
@AlbumenJ AlbumenJ added this to the 3.0.3 milestone Aug 15, 2021
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.

3 participants