-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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: Make the test assert if it encounters an error #4966
Conversation
@@ -1376,7 +1380,7 @@ func (s *testDBSuite) testRenameTable(c *C, storeStr, sql string) { | |||
failSQL = fmt.Sprintf(sql, "test1.t2", "test1.t2") | |||
s.testErrorCode(c, failSQL, tmysql.ErrTableExists) | |||
|
|||
s.tk.MustExec("drop table test1.t2") | |||
s.tk.MustExec("drop database test1") |
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.
Why change this case?
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.
Because Other tests will create this database. So we need clean it.
@@ -334,6 +332,7 @@ func (s *testDBSuite) TestCancelAddIndex(c *C) { | |||
checkErr = errors.Trace(err) | |||
return | |||
} | |||
jobIDs := []int64{job.ID} |
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.
Why this is better?
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's accurate job‘s ID.
Original test is failed but doesn't assert. So we can't find the job's ID is wrong.
LGTM |
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
Make sure the
c
comes fromTestXXX
.Make sure
TestCancelAddIndex
uses the corrected job's ID.