Skip to content

Commit

Permalink
ddl: make test stable (pingcap#4642)
Browse files Browse the repository at this point in the history
  • Loading branch information
zimulala authored and winoros committed Sep 26, 2017
1 parent c1d1ddc commit 19ecf92
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions ddl/ddl_db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,9 @@ func backgroundExec(s kv.Storage, sql string, done chan error) {
}

func (s *testDBSuite) TestAddUniqueIndexRollback(c *C) {
// t1 (c1 int, c2 int, c3 int, primary key(c1))
s.mustExec(c, "delete from t1")
s.mustExec(c, "use test_db")
s.mustExec(c, "drop table if exists t1")
s.mustExec(c, "create table t1 (c1 int, c2 int, c3 int, primary key(c1))")
// defaultBatchSize is equal to ddl.defaultBatchSize
base := defaultBatchSize * 2
count := base
Expand Down Expand Up @@ -277,6 +278,8 @@ LOOP:
s.mustExec(c, "delete from t1 where c1 = ?", i+10)
}
sessionExec(c, s.store, "create index c3_index on t1 (c3)")

s.mustExec(c, "drop table t1")
}

func (s *testDBSuite) TestAddAnonymousIndex(c *C) {
Expand Down Expand Up @@ -464,7 +467,7 @@ LOOP:
s.tk.MustExec("drop table t1")
}

func (s *testDBSuite) testDropIndex(c *C) {
func (s *testDBSuite) TestDropIndex(c *C) {
s.tk = testkit.NewTestKit(c, s.store)
s.tk.MustExec("use " + s.schemaName)
s.tk.MustExec("create table t1 (c1 int, c2 int, c3 int, primary key(c1))")
Expand Down

0 comments on commit 19ecf92

Please sign in to comment.