From f0feccb330820258baa760833eeb0782bf44542f Mon Sep 17 00:00:00 2001 From: Weizhen Wang Date: Sat, 11 Feb 2023 01:41:45 +0800 Subject: [PATCH 1/5] ddl: return panic when to get tiflash sync progress failed in test Signed-off-by: Weizhen Wang --- ddl/ddl_tiflash_api.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ddl/ddl_tiflash_api.go b/ddl/ddl_tiflash_api.go index 1ade909b93ee9..62fdfc6cfa43b 100644 --- a/ddl/ddl_tiflash_api.go +++ b/ddl/ddl_tiflash_api.go @@ -37,6 +37,7 @@ import ( "github.com/pingcap/tidb/store/helper" "github.com/pingcap/tidb/table" "github.com/pingcap/tidb/util" + "github.com/pingcap/tidb/util/intest" "github.com/pingcap/tidb/util/logutil" atomicutil "go.uber.org/atomic" "go.uber.org/zap" @@ -398,6 +399,10 @@ func pollAvailableTableProgress(schemas infoschema.InfoSchema, ctx sessionctx.Co zap.Int64("tableID", availableTableID.ID), zap.Bool("IsPartition", availableTableID.IsPartition), ) + if intest.InTest { + // https://github.com/pingcap/tidb/issues/39949 + panic(err) + } continue } err = infosync.UpdateTiFlashProgressCache(availableTableID.ID, progress) From 709129875b07f962eacaadf1aceaa8a10979cfb9 Mon Sep 17 00:00:00 2001 From: Weizhen Wang Date: Sun, 12 Feb 2023 00:54:31 +0800 Subject: [PATCH 2/5] *: update bazel Signed-off-by: Weizhen Wang --- ddl/tiflashtest/BUILD.bazel | 1 + 1 file changed, 1 insertion(+) diff --git a/ddl/tiflashtest/BUILD.bazel b/ddl/tiflashtest/BUILD.bazel index 2a803cf03c5af..b5598c6ae0261 100644 --- a/ddl/tiflashtest/BUILD.bazel +++ b/ddl/tiflashtest/BUILD.bazel @@ -7,6 +7,7 @@ go_test( "main_test.go", ], flaky = True, + shard_count = 30, deps = [ "//config", "//ddl", From 63690c6818e9059bf51a4032519b7e85594cf305 Mon Sep 17 00:00:00 2001 From: Weizhen Wang Date: Sun, 12 Feb 2023 01:20:33 +0800 Subject: [PATCH 3/5] *: update bazel Signed-off-by: Weizhen Wang --- ddl/tiflashtest/BUILD.bazel | 1 + 1 file changed, 1 insertion(+) diff --git a/ddl/tiflashtest/BUILD.bazel b/ddl/tiflashtest/BUILD.bazel index b5598c6ae0261..4e24ea074d7f4 100644 --- a/ddl/tiflashtest/BUILD.bazel +++ b/ddl/tiflashtest/BUILD.bazel @@ -2,6 +2,7 @@ load("@io_bazel_rules_go//go:def.bzl", "go_test") go_test( name = "tiflashtest_test", + timeout = "short", srcs = [ "ddl_tiflash_test.go", "main_test.go", From 7990152aad520b89e498669ebc6a692be59112fe Mon Sep 17 00:00:00 2001 From: Weizhen Wang Date: Mon, 13 Feb 2023 10:34:31 +0800 Subject: [PATCH 4/5] update Signed-off-by: Weizhen Wang --- ddl/ddl_tiflash_api.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ddl/ddl_tiflash_api.go b/ddl/ddl_tiflash_api.go index 62fdfc6cfa43b..acd0925eaff0e 100644 --- a/ddl/ddl_tiflash_api.go +++ b/ddl/ddl_tiflash_api.go @@ -400,7 +400,10 @@ func pollAvailableTableProgress(schemas infoschema.InfoSchema, ctx sessionctx.Co zap.Bool("IsPartition", availableTableID.IsPartition), ) if intest.InTest { - // https://github.com/pingcap/tidb/issues/39949 + // In the test, the server cannot start up because the port is occupied. + // Although the port is random. so we need to quickly return when to + // fail to get tiflash sync. + //https://github.com/pingcap/tidb/issues/39949 panic(err) } continue From c4723eeb1f1517ef73d7394e5723e6bab185732b Mon Sep 17 00:00:00 2001 From: Weizhen Wang Date: Mon, 13 Feb 2023 10:34:44 +0800 Subject: [PATCH 5/5] update Signed-off-by: Weizhen Wang --- ddl/ddl_tiflash_api.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ddl/ddl_tiflash_api.go b/ddl/ddl_tiflash_api.go index acd0925eaff0e..c601093ca5963 100644 --- a/ddl/ddl_tiflash_api.go +++ b/ddl/ddl_tiflash_api.go @@ -403,7 +403,7 @@ func pollAvailableTableProgress(schemas infoschema.InfoSchema, ctx sessionctx.Co // In the test, the server cannot start up because the port is occupied. // Although the port is random. so we need to quickly return when to // fail to get tiflash sync. - //https://github.com/pingcap/tidb/issues/39949 + // https://github.com/pingcap/tidb/issues/39949 panic(err) } continue