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

enhance ConsistentHashLoadBalance ut #2947

Merged
merged 5 commits into from
Dec 17, 2018
Merged

enhance ConsistentHashLoadBalance ut #2947

merged 5 commits into from
Dec 17, 2018

Conversation

lixiaojiee
Copy link
Contributor

@lixiaojiee lixiaojiee commented Dec 12, 2018

What is the purpose of the change

enhance ConsistentHashLoadBalance ut

Brief changelog

/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/loadbalance/ConsistentHashLoadBalanceTest.java
/dubbo-cluster/src/test/java/org/apache/dubbo/rpc/cluster/loadbalance/LoadBalanceBaseTest.java

Verifying this change

ut pass

Follow this checklist to help us incorporate your contribution quickly and easily:

  • 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.
  • Format the pull request title like [Dubbo-XXX] Fix UnknownException when host config not exist #XXX. 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.
  • 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 integration-test in test module.
  • Run mvn clean install -DskipTests & mvn clean test-compile failsafe:integration-test to make sure unit-test and integration-test pass.
  • If this contribution is large, please follow the Software Donation Guide.

@codecov-io
Copy link

codecov-io commented Dec 12, 2018

Codecov Report

Merging #2947 into master will increase coverage by 0.25%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2947      +/-   ##
==========================================
+ Coverage   63.91%   64.17%   +0.25%     
==========================================
  Files         584      584              
  Lines       26056    26056              
  Branches     4563     4563              
==========================================
+ Hits        16654    16721      +67     
+ Misses       7224     7155      -69     
- Partials     2178     2180       +2
Impacted Files Coverage Δ
...dubbo/rpc/protocol/dubbo/CallbackServiceCodec.java 77.2% <0%> (-2.21%) ⬇️
...apache/dubbo/rpc/protocol/dubbo/DubboProtocol.java 65.83% <0%> (-0.84%) ⬇️
...pache/dubbo/registry/support/AbstractRegistry.java 81.2% <0%> (-0.76%) ⬇️
...dubbo/remoting/exchange/support/DefaultFuture.java 67.78% <0%> (+0.67%) ⬆️
...bo/remoting/transport/netty/NettyCodecAdapter.java 54.68% <0%> (+1.56%) ⬆️
...a/org/apache/dubbo/monitor/dubbo/DubboMonitor.java 89.71% <0%> (+1.86%) ⬆️
...pache/dubbo/remoting/transport/AbstractServer.java 47.91% <0%> (+3.12%) ⬆️
...org/apache/dubbo/rpc/protocol/AbstractInvoker.java 66.12% <0%> (+3.22%) ⬆️
...ng/exchange/support/header/HeartbeatTimerTask.java 78.94% <0%> (+5.26%) ⬆️
...ubbo/rpc/protocol/dubbo/ChannelWrappedInvoker.java 50% <0%> (+8.33%) ⬆️
... and 5 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 1eb3067...47829a3. Read the comment docs.

@khanimteyaz
Copy link
Contributor

@lixiaojiee
Sorry for asking this. As I am new here so for the shake of my interest, would it be possible for you to provide some details about the UT, what scenarios it is covering and what was missing earlier? Appreciate your consideration,

@khanimteyaz
Copy link
Contributor

khanimteyaz commented Dec 12, 2018

@lixiaojiee
Sorry for asking this. As I am new here so for the shake of my interest, would it be possible for you to provide some details about the UT, what scenarios it is covering and what was missing earlier? Appreciate your consideration,

I think in this PR you are fixing the null pointer exception issue while calling getArgument of mocked invocation object in UT, because it was not mocked. Is this understanding of mine is correct?

@lixiaojiee
Copy link
Contributor Author

@khanimteyaz There are two reasons why I changed this ut:
1、Fix the null pointer exception
2、I found that the previous test cases were judged on the basis of the average value, which was obviously not reasonable for consistent hash loadbalance

@beiwei30 beiwei30 merged commit 83a75d3 into apache:master Dec 17, 2018
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