From db2abf198a1d2e4038077c76e8cb24eda5c37dda Mon Sep 17 00:00:00 2001 From: Yang Keao Date: Wed, 24 Apr 2024 11:02:30 +0800 Subject: [PATCH] combine into a single test Signed-off-by: Yang Keao --- pkg/server/internal/testserverclient/server_client.go | 6 +++--- pkg/server/tests/commontest/tidb_test.go | 9 ++------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/pkg/server/internal/testserverclient/server_client.go b/pkg/server/internal/testserverclient/server_client.go index 62b37880a46cf..fa6d42f42935e 100644 --- a/pkg/server/internal/testserverclient/server_client.go +++ b/pkg/server/internal/testserverclient/server_client.go @@ -2728,7 +2728,7 @@ func (cli *TestServerClient) RunTestConnectionCount(t *testing.T) { }) } -func (cli *TestServerClient) RunTestTypeOfSendLongData(t *testing.T) { +func (cli *TestServerClient) RunTestTypeAndCharsetOfSendLongData(t *testing.T) { cli.RunTests(t, func(config *mysql.Config) { config.MaxAllowedPacket = 1024 }, func(dbt *testkit.DBTestKit) { @@ -2753,9 +2753,7 @@ func (cli *TestServerClient) RunTestTypeOfSendLongData(t *testing.T) { require.Equal(t, str, j) } }) -} -func (cli *TestServerClient) RunTestCharsetOfSendLongData(t *testing.T) { str := strings.Repeat("你好", 1024) enc := simplifiedchinese.GBK.NewEncoder() gbkStr, err := enc.String(str) @@ -2769,6 +2767,8 @@ func (cli *TestServerClient) RunTestCharsetOfSendLongData(t *testing.T) { conn, err := dbt.GetDB().Conn(ctx) require.NoError(t, err) + _, err = conn.ExecContext(ctx, "drop table t") + require.NoError(t, err) _, err = conn.ExecContext(ctx, "CREATE TABLE t (t TEXT);") require.NoError(t, err) diff --git a/pkg/server/tests/commontest/tidb_test.go b/pkg/server/tests/commontest/tidb_test.go index ace03c656a872..d1c1846bf6408 100644 --- a/pkg/server/tests/commontest/tidb_test.go +++ b/pkg/server/tests/commontest/tidb_test.go @@ -3083,12 +3083,7 @@ func TestConnectionCount(t *testing.T) { ts.RunTestConnectionCount(t) } -func TestTypeOfSendLongData(t *testing.T) { +func TestTypeAndCharsetOfSendLongData(t *testing.T) { ts := servertestkit.CreateTidbTestSuite(t) - ts.RunTestTypeOfSendLongData(t) -} - -func TestCharsetOfSendLongData(t *testing.T) { - ts := servertestkit.CreateTidbTestSuite(t) - ts.RunTestCharsetOfSendLongData(t) + ts.RunTestTypeAndCharsetOfSendLongData(t) }