Skip to content
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

Merged
merged 2 commits into from
Nov 2, 2017

Conversation

zimulala
Copy link
Contributor

Make sure the c comes from TestXXX.
Make sure TestCancelAddIndex uses the corrected job's ID.

@@ -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")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why change this case?

Copy link
Contributor Author

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}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this is better?

Copy link
Contributor Author

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.

@coocood
Copy link
Member

coocood commented Nov 2, 2017

LGTM

Copy link
Member

@zz-jason zz-jason left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@coocood coocood merged commit 89a5361 into pingcap:master Nov 2, 2017
@zimulala zimulala deleted the run-test branch December 16, 2017 04:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants