Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

*: make TestDisable stable #7487

Merged
merged 3 commits into from
Nov 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/schedule/coordinator.go
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,7 @@ func (c *Coordinator) InitSchedulers(needRun bool) {
if err := c.cluster.GetSchedulerConfig().Persist(c.cluster.GetStorage()); err != nil {
log.Error("cannot persist schedule config", errs.ZapError(err))
}
log.Info("scheduler config is updated", zap.Reflect("scheduler-config", scheduleCfg.Schedulers))

c.markSchedulersInitialized()
}
Expand Down
5 changes: 5 additions & 0 deletions server/cluster/cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,10 @@ func (c *RaftCluster) startGCTuner() {
func (c *RaftCluster) runStoreConfigSync() {
defer logutil.LogPanic()
defer c.wg.Done()
// TODO: After we fix the atomic problem of config, we can remove this failpoint.
failpoint.Inject("skipStoreConfigSync", func() {
failpoint.Return()
})

var (
synced, switchRaftV2Config, needPersist bool
Expand All @@ -491,6 +495,7 @@ func (c *RaftCluster) runStoreConfigSync() {
if err := c.opt.Persist(c.storage); err != nil {
log.Warn("store config persisted failed", zap.Error(err))
}
log.Info("store config is updated")
}
select {
case <-c.ctx.Done():
Expand Down
2 changes: 2 additions & 0 deletions tests/server/api/scheduler_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -566,8 +566,10 @@ func (suite *scheduleTestSuite) checkAPI(cluster *tests.TestCluster) {
}

func (suite *scheduleTestSuite) TestDisable() {
suite.NoError(failpoint.Enable("github.com/tikv/pd/server/cluster/skipStoreConfigSync", `return(true)`))
env := tests.NewSchedulingTestEnvironment(suite.T())
env.RunTestInTwoModes(suite.checkDisable)
suite.NoError(failpoint.Disable("github.com/tikv/pd/server/cluster/skipStoreConfigSync"))
}

func (suite *scheduleTestSuite) checkDisable(cluster *tests.TestCluster) {
Expand Down
Loading