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: migrate test-infra to testify for tiflash_replica_test.go #33336

Merged
merged 6 commits into from
Mar 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ddl/column_modify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -885,15 +885,15 @@ func TestTransactionWithWriteOnlyColumn(t *testing.T) {
dom.DDL().SetHook(hook)
done := make(chan error, 1)
// test transaction on add column.
go backgroundExecT(store, "alter table t1 add column c int not null", done)
go backgroundExec(store, "alter table t1 add column c int not null", done)
err := <-done
require.NoError(t, err)
require.NoError(t, checkErr)
tk.MustQuery("select a from t1").Check(testkit.Rows("2"))
tk.MustExec("delete from t1")

// test transaction on drop column.
go backgroundExecT(store, "alter table t1 drop column c", done)
go backgroundExec(store, "alter table t1 drop column c", done)
err = <-done
require.NoError(t, err)
require.NoError(t, checkErr)
Expand Down
433 changes: 1 addition & 432 deletions ddl/db_legacy_test.go

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions ddl/db_partition_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2831,7 +2831,7 @@ func testPartitionCancelAddIndex(t *testing.T, store kv.Storage, d ddl.DDL, leas
jobIDExt := wrapJobIDExtCallback(hook)
d.SetHook(jobIDExt)
done := make(chan error, 1)
go backgroundExecT(store, addIdxSQL, done)
go backgroundExec(store, addIdxSQL, done)

times := 0
ticker := time.NewTicker(lease / 2)
Expand Down Expand Up @@ -3619,9 +3619,9 @@ func TestTruncatePartitionMultipleTimes(t *testing.T) {
}
}
done1 := make(chan error, 1)
go backgroundExecT(store, "alter table test.t truncate partition p0;", done1)
go backgroundExec(store, "alter table test.t truncate partition p0;", done1)
done2 := make(chan error, 1)
go backgroundExecT(store, "alter table test.t truncate partition p0;", done2)
go backgroundExec(store, "alter table test.t truncate partition p0;", done2)
<-done1
<-done2
require.LessOrEqual(t, errCount, int32(1))
Expand Down
8 changes: 4 additions & 4 deletions ddl/db_table_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -308,15 +308,15 @@ func TestTransactionOnAddDropColumn(t *testing.T) {
dom.DDL().SetHook(hook)
done := make(chan error, 1)
// test transaction on add column.
go backgroundExecT(store, "alter table t1 add column c int not null after a", done)
go backgroundExec(store, "alter table t1 add column c int not null after a", done)
err := <-done
require.NoError(t, err)
require.Nil(t, checkErr)
tk.MustQuery("select a,b from t1 order by a").Check(testkit.Rows("1 1", "1 1", "1 1", "2 2", "2 2", "2 2"))
tk.MustExec("delete from t1")

// test transaction on drop column.
go backgroundExecT(store, "alter table t1 drop column c", done)
go backgroundExec(store, "alter table t1 drop column c", done)
err = <-done
require.NoError(t, err)
require.Nil(t, checkErr)
Expand Down Expand Up @@ -1052,7 +1052,7 @@ func TestAddColumn2(t *testing.T) {
dom.DDL().SetHook(hook)
done := make(chan error, 1)
// test transaction on add column.
go backgroundExecT(store, "alter table t1 add column c int not null", done)
go backgroundExec(store, "alter table t1 add column c int not null", done)
err := <-done
require.NoError(t, err)

Expand Down Expand Up @@ -1094,7 +1094,7 @@ func TestAddColumn2(t *testing.T) {
}
dom.DDL().SetHook(hook)

go backgroundExecT(store, "alter table t2 add column b int not null default 3", done)
go backgroundExec(store, "alter table t2 add column b int not null default 3", done)
err = <-done
require.NoError(t, err)
re.Check(testkit.Rows("1 2"))
Expand Down
2 changes: 1 addition & 1 deletion ddl/db_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ func TestIssue22307(t *testing.T) {
dom.DDL().SetHook(hook)
done := make(chan error, 1)
// test transaction on add column.
go backgroundExecT(store, "alter table t drop column b;", done)
go backgroundExec(store, "alter table t drop column b;", done)
err := <-done
require.NoError(t, err)
require.EqualError(t, checkErr1, "[planner:1054]Unknown column 'b' in 'where clause'")
Expand Down
4 changes: 2 additions & 2 deletions ddl/index_modify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ func testAddIndexRollback(t *testing.T, idxName, addIdxSQL, errMsg string, hasNu
}

done := make(chan error, 1)
go backgroundExecT(store, addIdxSQL, done)
go backgroundExec(store, addIdxSQL, done)

times := 0
ticker := time.NewTicker(indexModifyLease / 2)
Expand Down Expand Up @@ -730,7 +730,7 @@ func testCancelAddIndex(t *testing.T, store kv.Storage, dom *domain.Domain, idxN
jobIDExt := wrapJobIDExtCallback(hook)
d.SetHook(jobIDExt)
done := make(chan error, 1)
go backgroundExecT(store, addIdxSQL, done)
go backgroundExec(store, addIdxSQL, done)

times := 0
ticker := time.NewTicker(indexModifyLease / 2)
Expand Down
2 changes: 1 addition & 1 deletion ddl/modify_column_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -972,7 +972,7 @@ func TestModifyColumnRollBack(t *testing.T) {

dom.DDL().SetHook(hook)
done := make(chan error, 1)
go backgroundExecT(store, "alter table test.t1 change c2 c2 bigint not null;", done)
go backgroundExec(store, "alter table test.t1 change c2 c2 bigint not null;", done)

err := <-done
require.EqualError(t, err, "[ddl:8214]Cancelled DDL job")
Expand Down
Loading