diff --git a/domain/db_test.go b/domain/db_test.go index eee241ee7b0d4..990ec2ad41a70 100644 --- a/domain/db_test.go +++ b/domain/db_test.go @@ -25,8 +25,7 @@ import ( "github.com/stretchr/testify/require" ) -// SubTestDomainSession is batched in TestDomainSerial -func SubTestDomainSession(t *testing.T) { +func TestDomainSession(t *testing.T) { lease := 50 * time.Millisecond store, err := mockstore.NewMockStore() require.NoError(t, err) diff --git a/domain/domain_test.go b/domain/domain_test.go index 4d9e96ebdd913..bed887c72133f 100644 --- a/domain/domain_test.go +++ b/domain/domain_test.go @@ -45,8 +45,7 @@ import ( "go.etcd.io/etcd/integration" ) -// SubTestInfo is batched in TestDomainSerial -func SubTestInfo(t *testing.T) { +func TestInfo(t *testing.T) { if runtime.GOOS == "windows" { t.Skip("integration.NewClusterV3 will create file contains a colon which is not allowed on Windows") } @@ -154,8 +153,7 @@ func SubTestInfo(t *testing.T) { require.NoError(t, failpoint.Disable("github.com/pingcap/tidb/domain/infosync/FailPlacement")) } -// SubTestDomain is batched in TestDomainSerial -func SubTestDomain(t *testing.T) { +func TestDomain(t *testing.T) { store, err := mockstore.NewMockStore() require.NoError(t, err) diff --git a/domain/main_test.go b/domain/main_test.go index 969d50e4a0f67..aaa108626c8f3 100644 --- a/domain/main_test.go +++ b/domain/main_test.go @@ -17,7 +17,6 @@ package domain_test import ( "testing" - . "github.com/pingcap/tidb/domain" "github.com/pingcap/tidb/util/testbridge" "go.uber.org/goleak" ) @@ -30,11 +29,3 @@ func TestMain(m *testing.M) { } goleak.VerifyTestMain(m, opts...) } - -// TestDomainSerial handles tests in serial -func TestDomainSerial(t *testing.T) { - // these tests should run in serial for failpoint is global - t.Run("info", SubTestInfo) - t.Run("domain", SubTestDomain) - t.Run("domainSession", SubTestDomainSession) -} diff --git a/executor/executor_pkg_test.go b/executor/executor_pkg_test.go index 51453e177b568..afe244bcf7a82 100644 --- a/executor/executor_pkg_test.go +++ b/executor/executor_pkg_test.go @@ -98,16 +98,7 @@ func (msm *mockSessionManager) SetServerID(serverID uint64) { msm.serverID = serverID } -func TestExecutorPkg(t *testing.T) { - t.Run("ShowProcessList", SubTestShowProcessList) - t.Run("BuildKvRangesForIndexJoinWithoutCwc", SubTestBuildKvRangesForIndexJoinWithoutCwc) - t.Run("GetFieldsFromLine", SubTestGetFieldsFromLine) - t.Run("SlowQueryRuntimeStats", SubTestSlowQueryRuntimeStats) - t.Run("AggPartialResultMapperB", SubTestAggPartialResultMapperB) - t.Run("FilterTemporaryTableKeys", SubTestFilterTemporaryTableKeys) -} - -func SubTestShowProcessList(t *testing.T) { +func TestShowProcessList(t *testing.T) { // Compose schema. names := []string{"Id", "User", "Host", "db", "Command", "Time", "State", "Info"} ftypes := []byte{mysql.TypeLonglong, mysql.TypeVarchar, mysql.TypeVarchar, @@ -180,7 +171,7 @@ func buildSchema(names []string, ftypes []byte) *expression.Schema { return schema } -func SubTestBuildKvRangesForIndexJoinWithoutCwc(t *testing.T) { +func TestBuildKvRangesForIndexJoinWithoutCwc(t *testing.T) { indexRanges := make([]*ranger.Range, 0, 6) indexRanges = append(indexRanges, generateIndexRange(1, 1, 1, 1, 1)) indexRanges = append(indexRanges, generateIndexRange(1, 1, 2, 1, 1)) @@ -224,7 +215,7 @@ func generateDatumSlice(vals ...int64) []types.Datum { return datums } -func SubTestGetFieldsFromLine(t *testing.T) { +func TestGetFieldsFromLine(t *testing.T) { tests := []struct { input string expected []string @@ -282,7 +273,7 @@ func assertEqualStrings(t *testing.T, got []field, expect []string) { } } -func SubTestSlowQueryRuntimeStats(t *testing.T) { +func TestSlowQueryRuntimeStats(t *testing.T) { stats := &slowQueryRuntimeStats{ totalFileNum: 2, readFileNum: 2, @@ -300,7 +291,7 @@ func SubTestSlowQueryRuntimeStats(t *testing.T) { // Test whether the actual buckets in Golang Map is same with the estimated number. // The test relies the implement of Golang Map. ref https://github.com/golang/go/blob/go1.13/src/runtime/map.go#L114 -func SubTestAggPartialResultMapperB(t *testing.T) { +func TestAggPartialResultMapperB(t *testing.T) { if runtime.Version() < `go1.13` { t.Skip("Unsupported version") } @@ -392,7 +383,7 @@ func getGrowing(m aggPartialResultMapper) bool { return value.oldbuckets != nil } -func SubTestFilterTemporaryTableKeys(t *testing.T) { +func TestFilterTemporaryTableKeys(t *testing.T) { vars := variable.NewSessionVars() const tableID int64 = 3 vars.TxnCtx = &variable.TransactionContext{