-
Notifications
You must be signed in to change notification settings - Fork 8.1k
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
Add test cases for different ProcessorSlot #598
base: master
Are you sure you want to change the base?
Conversation
Thanks for contributing.
IMHO, |
Oh, I see. Previously I just found the implement way is different in four slots, and thought unified may be better. I agree with you, the How about move In slot |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #598 +/- ##
============================================
+ Coverage 42.25% 42.48% +0.23%
- Complexity 1419 1428 +9
============================================
Files 307 307
Lines 8894 8894
Branches 1203 1203
============================================
+ Hits 3758 3779 +21
+ Misses 4677 4658 -19
+ Partials 459 457 -2 ☔ View full report in Codecov by Sentry. |
Could you please resolve the conflicts? :) |
…ed max check times to system topic (alibaba#633) * add logic of putting message that exceeds max-check-times to system topic TRANS_CHECK_MAXTIME_TOPIC * add test case:testResolveDiscardMsg * add @after logic to test case * comment brokerController.shutdown and use mock * add logic of resuming half message check * add test case:resumeCheckHalfMessage * delete commented codes
Describe what this PR does / why we need it
Add some test cases for different ProcessorSlot,
NodeSelectorSlot
,ClusterBuilderSlot
and so on.Does this pull request fix one issue?
Related to #580
Describe how you did it
Add
testFireEntry
method for each Slot to verifyfireEntry
method has been called inentry
method,and called only once.
Add
testFireExit
method for each Slot to verifyfireExit
method has been called inexit
method,and called only once.
Add some test cases to test the interactions in
entry
method, by mocking and verify the interactionof
Node
andSlot
.Describe how to verify it
Run the test cases.
Special notes for reviews
The
ClusterNodeBuilderTest
is renamed toClusterBuilderSlotTest
for more standard test Class name.The
DegradeSlot
andSystemSlot
using static method to check the rules:DegradeRuleManager.checkDegrade(resourceWrapper, context, node, count);
SystemRuleManager.checkSystem(resourceWrapper);
,while
FlowSlot
andAuthoritySlot
call the internal method.Maybe they can be unified in the furture.
I think using static method in
XxxRuleManager
is better, since it makes the slot class more testable,and we can write separate test cases for
XxxRuleManager
.This is a suggestion, they're not modified yet.