-
Notifications
You must be signed in to change notification settings - Fork 711
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
tests: avoid some test branches not being reached #8087
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: lhy1024 <admin@liudos.us>
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. Reviewer can indicate their review by submitting an approval review. |
@@ -527,25 +534,12 @@ func checkHotWriteRegionScheduleByteRateOnly(re *require.Assertions, enablePlace | |||
clearPendingInfluence(hb.(*hotScheduler)) | |||
tc.SetHotRegionScheduleLimit(int(opt.GetHotRegionScheduleLimit())) | |||
|
|||
for i := 0; i < 20; i++ { |
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.
This part is duplicated with L500-L522. But this branch, which tests the transfer leader, is not reached, so it is not updated before.
pdServerCfg := tc.GetPDServerConfig() | ||
pdServerCfg.FlowRoundByDigit = 8 |
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.
Add config to avoid test branches not being reached
re.Equal("move-hot-write-leader", op.Desc()) | ||
operatorutil.CheckTransferLearner(re, op, operator.OpHotRegion, 8, 10) | ||
re.Equal("move-hot-write-peer", op.Desc()) | ||
operatorutil.CheckTransferLearner(re, op, operator.OpHotRegion, 8, 0) |
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.
it may be scheduled to store 10 or store 11
Signed-off-by: lhy1024 <admin@liudos.us>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #8087 +/- ##
==========================================
- Coverage 77.38% 77.38% -0.01%
==========================================
Files 471 471
Lines 61478 61355 -123
==========================================
- Hits 47574 47477 -97
+ Misses 10345 10315 -30
- Partials 3559 3563 +4
Flags with carried forward coverage won't be shown. Click here to find out more. |
// schedulePeerPr the probability of schedule the hot peer. | ||
schedulePeerPr = 0.66 | ||
schedulePeerPr = defaultSchedulePeerPr | ||
// pendingAmpFactor will amplify the impact of pending influence, making scheduling slower or even serial when two stores are close together | ||
pendingAmpFactor = 2.0 | ||
pendingAmpFactor = defaultPendingAmpFactor | ||
// If the distribution of a dimension is below the corresponding stddev threshold, then scheduling will no longer be based on this dimension, | ||
// as it implies that this dimension is sufficiently uniform. | ||
stddevThreshold = 0.1 | ||
stddevThreshold = defaultStddevThreshold | ||
// topnPosition is the position of the topn peer in the hot peer list. | ||
// We use it to judge whether to schedule the hot peer in some cases. | ||
topnPosition = 10 | ||
topnPosition = defaultTopnPosition |
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.
These variables are too complicated. Moreover, the current hot tests are hard to understand and debug.
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.
Yes, I will try to reduce these variables and to make test clear in later prs.
What problem does this PR solve?
Issue Number: Close #8073
What is changed and how does it work?
schedulePeerPr always be 1.0, which makes some test cannot reach transfer-leader branch
Check List
Tests
Release note