From 3d229de891cee9902e1d5ed225de43775d3f7043 Mon Sep 17 00:00:00 2001 From: wjhuang2016 Date: Fri, 23 Jul 2021 17:33:00 +0800 Subject: [PATCH 1/4] done Signed-off-by: wjhuang2016 --- ddl/db_test.go | 6 +++--- go_test_tidb.sh | 18 ++++++++++++++++++ 2 files changed, 21 insertions(+), 3 deletions(-) create mode 100755 go_test_tidb.sh diff --git a/ddl/db_test.go b/ddl/db_test.go index 01c2546be6108..f150d366172ec 100644 --- a/ddl/db_test.go +++ b/ddl/db_test.go @@ -294,7 +294,6 @@ func backgroundExec(s kv.Storage, sql string, done chan error) { // TestAddPrimaryKeyRollback1 is used to test scenarios that will roll back when a duplicate primary key is encountered. func (s *testDBSuite8) TestAddPrimaryKeyRollback1(c *C) { - c.Skip("unstable, skip it and fix it before 20210705") hasNullValsInKey := false idxName := "PRIMARY" addIdxSQL := "alter table t1 add primary key c3_index (c3);" @@ -495,8 +494,9 @@ LOOP: // delete some rows, and add some data for i := count; i < count+step; i++ { n := rand.Intn(count) - // Don't delete this row, otherwise error message would change. - if n == defaultBatchSize*2-10 { + // (2048, 2038, 2038) and (2038, 2038, 2038) + // Don't delete rows where c1 is 2048 or 2038, otherwise error message would change. + if n == defaultBatchSize*2-10 || n == defaultBatchSize*2 { continue } tk.MustExec("delete from t1 where c1 = ?", n) diff --git a/go_test_tidb.sh b/go_test_tidb.sh new file mode 100755 index 0000000000000..3142fe569a4fe --- /dev/null +++ b/go_test_tidb.sh @@ -0,0 +1,18 @@ +#!/bin/bash + + +echo "start" + +for ((i = 0 ; i <= 1000 ; i++)) +do + echo "$i" + go clean -testcache +# go test -v -vet=off -p 5 -timeout 20m -race github.com/pingcap/tidb/executor > c + go test ./ddl -check.f TestAddPrimaryKeyRollback1 > a +# go test -v ./executor/... > c +# make test > c +# make test > c + if [ $? -ne 0 ]; then + exit 1 + fi +done From 184da2de0894e1fda8e2fb89845cf376a54a92e4 Mon Sep 17 00:00:00 2001 From: wjhuang2016 Date: Fri, 23 Jul 2021 17:33:31 +0800 Subject: [PATCH 2/4] clean Signed-off-by: wjhuang2016 --- go_test_tidb.sh | 18 ------------------ 1 file changed, 18 deletions(-) delete mode 100755 go_test_tidb.sh diff --git a/go_test_tidb.sh b/go_test_tidb.sh deleted file mode 100755 index 3142fe569a4fe..0000000000000 --- a/go_test_tidb.sh +++ /dev/null @@ -1,18 +0,0 @@ -#!/bin/bash - - -echo "start" - -for ((i = 0 ; i <= 1000 ; i++)) -do - echo "$i" - go clean -testcache -# go test -v -vet=off -p 5 -timeout 20m -race github.com/pingcap/tidb/executor > c - go test ./ddl -check.f TestAddPrimaryKeyRollback1 > a -# go test -v ./executor/... > c -# make test > c -# make test > c - if [ $? -ne 0 ]; then - exit 1 - fi -done From c3919313fee908dc00b849b4030eafd1d543100b Mon Sep 17 00:00:00 2001 From: wjhuang2016 Date: Fri, 23 Jul 2021 17:38:59 +0800 Subject: [PATCH 3/4] fix Signed-off-by: wjhuang2016 --- ddl/db_test.go | 1 - 1 file changed, 1 deletion(-) diff --git a/ddl/db_test.go b/ddl/db_test.go index 2570463dfd8db..4954b776f5b53 100644 --- a/ddl/db_test.go +++ b/ddl/db_test.go @@ -311,7 +311,6 @@ func (s *testDBSuite8) TestAddPrimaryKeyRollback2(c *C) { } func (s *testDBSuite2) TestAddUniqueIndexRollback(c *C) { - c.Skip("unstable, skip it and fix it before 20210702") hasNullValsInKey := false idxName := "c3_index" addIdxSQL := "create unique index c3_index on t1 (c3)" From 8085996bdc3fa30f93e7d2ddd5ba7344b5baf78d Mon Sep 17 00:00:00 2001 From: wjHuang Date: Wed, 4 Aug 2021 16:18:56 +0800 Subject: [PATCH 4/4] Update ddl/db_test.go Co-authored-by: Lynn --- ddl/db_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ddl/db_test.go b/ddl/db_test.go index 4954b776f5b53..0ca305a7bb6e6 100644 --- a/ddl/db_test.go +++ b/ddl/db_test.go @@ -515,7 +515,7 @@ LOOP: for i := count; i < count+step; i++ { n := rand.Intn(count) // (2048, 2038, 2038) and (2038, 2038, 2038) - // Don't delete rows where c1 is 2048 or 2038, otherwise error message would change. + // Don't delete rows where c1 is 2048 or 2038, otherwise, the entry value in duplicated error message would change. if n == defaultBatchSize*2-10 || n == defaultBatchSize*2 { continue }