Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

Commit

Permalink
fix ci
Browse files Browse the repository at this point in the history
  • Loading branch information
3pointer committed Nov 10, 2020
1 parent 6f141e6 commit 7cf0c64
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions pkg/pdutil/pd.go
Original file line number Diff line number Diff line change
Expand Up @@ -509,12 +509,12 @@ func (p *PdController) RemoveSchedulers(ctx context.Context) (undo utils.UndoFun
// Ignore non-exist config.
continue
}
switch cfgVal.(type) {
switch v := cfgVal.(type) {
case bool:
disablePDCfg[cfgKey] = false
case int:
limit := int(value.(float64))
disablePDCfg[cfgKey] = int(math.Min(40, float64(limit*len(stores)))) * cfgVal.(int)
disablePDCfg[cfgKey] = int(math.Min(40, float64(limit*len(stores)))) * v
}
}
undo = p.makeUndoFunctionByConfig(clusterConfig{scheduleCfg: scheduleCfg})
Expand Down
4 changes: 2 additions & 2 deletions pkg/pdutil/pd_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func (s *testPDControllerSuite) TestScheduler(c *C) {
}
schedulerPauseCh := make(chan struct{})
pdController := &PdController{addrs: []string{"", ""}, schedulerPauseCh: schedulerPauseCh}
_, err := pdController.pauseSchedulersAndConfigWith(ctx, []string{scheduler}, mock)
_, err := pdController.pauseSchedulersAndConfigWith(ctx, []string{scheduler}, nil, mock)
c.Assert(err, ErrorMatches, "failed")

go func() {
Expand All @@ -53,7 +53,7 @@ func (s *testPDControllerSuite) TestScheduler(c *C) {
mock = func(context.Context, string, string, *http.Client, string, io.Reader) ([]byte, error) {
return []byte(`["` + scheduler + `"]`), nil
}
_, err = pdController.pauseSchedulersAndConfigWith(ctx, []string{scheduler}, mock)
_, err = pdController.pauseSchedulersAndConfigWith(ctx, []string{scheduler}, nil, mock)
c.Assert(err, IsNil)

go func() {
Expand Down

0 comments on commit 7cf0c64

Please sign in to comment.