diff --git a/client/resource_group/controller/controller.go b/client/resource_group/controller/controller.go index a8e86ca6adb..e3495a21ff1 100755 --- a/client/resource_group/controller/controller.go +++ b/client/resource_group/controller/controller.go @@ -323,7 +323,7 @@ func (c *ResourceGroupsController) Start(ctx context.Context) { group := &rmpb.ResourceGroup{} switch item.Type { case meta_storagepb.Event_PUT: - if err := proto.Unmarshal(item.Kv.Value, group); err != nil { + if err = proto.Unmarshal(item.Kv.Value, group); err != nil { continue } if item, ok := c.groupsController.Load(group.Name); ok { @@ -332,7 +332,7 @@ func (c *ResourceGroupsController) Start(ctx context.Context) { } case meta_storagepb.Event_DELETE: if item.PrevKv != nil { - if err := proto.Unmarshal(item.PrevKv.Value, group); err != nil { + if err = proto.Unmarshal(item.PrevKv.Value, group); err != nil { continue } if _, ok := c.groupsController.LoadAndDelete(group.Name); ok { diff --git a/tests/integrations/mcs/resourcemanager/resource_manager_test.go b/tests/integrations/mcs/resourcemanager/resource_manager_test.go index 50df5298122..7cdae67374a 100644 --- a/tests/integrations/mcs/resourcemanager/resource_manager_test.go +++ b/tests/integrations/mcs/resourcemanager/resource_manager_test.go @@ -18,8 +18,6 @@ import ( "context" "encoding/json" "fmt" - "github.com/pingcap/log" - "go.uber.org/zap" "io" "math/rand" "net/http" @@ -248,9 +246,10 @@ func (suite *resourceManagerClientTestSuite) TestWatchResourceGroup() { testutil.Eventually(re, func() bool { name := "test" + strconv.Itoa(i) meta = controller.GetActiveResourceGroup(name) - re.NotNil(meta) - log.Info("meta check", zap.Any("meta", meta), zap.Any("group", group)) - return meta.RUSettings.RU.Settings.FillRate == uint64(20000) + if meta != nil { + return meta.RUSettings.RU.Settings.FillRate == uint64(20000) + } + return false }, testutil.WithTickInterval(50*time.Millisecond)) }