Skip to content

Commit

Permalink
ddl: return panic when to get tiflash sync progress failed in test (p…
Browse files Browse the repository at this point in the history
  • Loading branch information
hawkingrei authored and blacktear23 committed Feb 15, 2023
1 parent 2667997 commit aff8784
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
8 changes: 8 additions & 0 deletions ddl/ddl_tiflash_api.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -398,6 +399,13 @@ func pollAvailableTableProgress(schemas infoschema.InfoSchema, ctx sessionctx.Co
zap.Int64("tableID", availableTableID.ID),
zap.Bool("IsPartition", availableTableID.IsPartition),
)
if intest.InTest {
// 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
}
err = infosync.UpdateTiFlashProgressCache(availableTableID.ID, progress)
Expand Down
2 changes: 2 additions & 0 deletions ddl/tiflashtest/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@ 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",
],
flaky = True,
shard_count = 30,
deps = [
"//config",
"//ddl",
Expand Down

0 comments on commit aff8784

Please sign in to comment.