-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
ddl: fix unstable tests #26513
ddl: fix unstable tests #26513
Conversation
Signed-off-by: wjhuang2016 <[email protected]>
Signed-off-by: wjhuang2016 <[email protected]>
Signed-off-by: wjhuang2016 <[email protected]>
No release note, Please follow https://github.com/pingcap/community/blob/master/contributors/release-note-checker.md |
[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. |
@@ -516,8 +514,9 @@ LOOP: | |||
// delete some rows, and add some data | |||
for i := count; i < count+step; i++ { | |||
n := rand.Intn(count) | |||
// Don't delete this row, otherwise error message would change. | |||
if n == defaultBatchSize*2-10 { | |||
// (2048, 2038, 2038) and (2038, 2038, 2038) |
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.
I don't get the comment here. Could you add an explanation with more details?
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 are the two duplicate rows. So we shouldn't delete either of them.
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.
rand.Intn(2048) won't return 2048, according to the doc: https://pkg.go.dev/math/rand#Rand.Intn
BTW, it's a little hard to understand. Why not just remove data in the range of [0, 2037]?
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.
count += step, so it may > 2048.
This test wants to randomly delete some rows. So it doesn't remove data in the range of [0, 2037] directly.
It's not easy to understand, that why I missed this check at the first fix.
Co-authored-by: Lynn <[email protected]>
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.
LGTM
/merge |
This pull request has been accepted and is ready to merge. Commit hash: 8085996
|
fail caused by #24679 |
@wjhuang2016: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
What problem does this PR solve?
Issue Number: close #25634, close #25456
Don't delete the duplicate row.
What is changed and how it works?
Don't delete the duplicate row.
Check List
Tests
Side effects
Documentation
Release note