-
Notifications
You must be signed in to change notification settings - Fork 4.6k
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
[Improvement] Add deregister Test on Master moudle #16142
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #16142 +/- ##
============================================
- Coverage 40.73% 40.71% -0.02%
+ Complexity 5250 5246 -4
============================================
Files 1385 1385
Lines 46109 46076 -33
Branches 4923 4899 -24
============================================
- Hits 18781 18759 -22
+ Misses 25401 25389 -12
- Partials 1927 1928 +1 ☔ View full report in Codecov by Sentry. |
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Lines 188 to 200 in a13eacd
public void deregister() { | |
try { | |
registryClient.remove(masterConfig.getMasterRegistryPath()); | |
log.info("Master node : {} unRegistry to register center.", masterConfig.getMasterAddress()); | |
if (masterHeartBeatTask != null) { | |
masterHeartBeatTask.shutdown(); | |
} | |
registryClient.close(); | |
} catch (Exception e) { | |
log.error("MasterServer remove registry path exception ", e); | |
} | |
} | |
IMHO at least you need to verify the behavior of injected registryClient mock after calling masterRegistryClient.deregister()
. To make things fully covered, you may also test the exception handling block, which is no necessary in this case though. Simply calling masterRegistryClient.deregister()
is not a meaningful test case.
Thanks, I will close this pr and see if there is any way to improve it later |
Purpose of the pull request
Add deregistryTest on Master moudle
Brief change log
Verify this pull request
This pull request is code cleanup without any test coverage.
(or)
This pull request is already covered by existing tests, such as (please describe tests).
(or)
This change added tests and can be verified as follows:
(or)
If your pull request contain incompatible change, you should also add it to
docs/docs/en/guide/upgrede/incompatible.md