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

Clean shared state pollution to avoid flaky tests. #8401

Merged
merged 1 commit into from
Aug 3, 2021
Merged

Clean shared state pollution to avoid flaky tests. #8401

merged 1 commit into from
Aug 3, 2021

Conversation

LALAYANG
Copy link
Contributor

@LALAYANG LALAYANG commented Aug 2, 2021

Link to issue: #8390

What is the purpose of the change

This PR is to fix a non-idempotent test org.apache.dubbo.rpc.filter.ExecuteLimitFilterTest.testExecuteLimitInvokeWitException

  • The test does not remove RpcStatus after running, which pollutes the state shared among tests.
  • 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

Removes the status of RPC when the test ends.

Verifying this change

With the proposed fix, the test does not pollute the shared state (and passes when run twice 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.

Fix a flaky test.

Clean shared state pollution to avoid flaky tests.
Copy link
Member

@horizonzy horizonzy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@codecov-commenter
Copy link

codecov-commenter commented Aug 3, 2021

Codecov Report

Merging #8401 (04b9da2) into 3.0 (a4d86f8) will increase coverage by 0.00%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff            @@
##                3.0    #8401   +/-   ##
=========================================
  Coverage     63.20%   63.20%           
- Complexity      312      313    +1     
=========================================
  Files          1099     1099           
  Lines         46055    46056    +1     
  Branches       6955     6954    -1     
=========================================
+ Hits          29107    29109    +2     
- Misses        13697    13698    +1     
+ Partials       3251     3249    -2     
Impacted Files Coverage Δ
.../apache/dubbo/remoting/transport/AbstractPeer.java 65.21% <0.00%> (-4.35%) ⬇️
.../dubbo/remoting/transport/netty4/NettyChannel.java 64.35% <0.00%> (-1.99%) ⬇️
.../exchange/support/header/HeaderExchangeServer.java 66.98% <0.00%> (-1.89%) ⬇️
...ting/zookeeper/curator/CuratorZookeeperClient.java 67.48% <0.00%> (-0.99%) ⬇️
...he/dubbo/registry/multicast/MulticastRegistry.java 66.66% <0.00%> (-0.93%) ⬇️
...org/apache/dubbo/registry/nacos/NacosRegistry.java 0.00% <0.00%> (ø)
...apache/dubbo/common/extension/ExtensionLoader.java 79.20% <0.00%> (+0.41%) ⬆️
...stry/client/ServiceDiscoveryRegistryDirectory.java 47.36% <0.00%> (+0.95%) ⬆️
...pache/dubbo/registry/support/AbstractRegistry.java 79.56% <0.00%> (+1.45%) ⬆️
...e/dubbo/remoting/transport/netty/NettyChannel.java 60.22% <0.00%> (+4.54%) ⬆️

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 a4d86f8...04b9da2. Read the comment docs.

Copy link
Contributor

@xiaoheng1 xiaoheng1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@horizonzy horizonzy merged commit bb94723 into apache:3.0 Aug 3, 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.

4 participants