Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
Signed-off-by: husharp <[email protected]>
  • Loading branch information
HuSharp committed Sep 19, 2023
1 parent f9b5764 commit 289af93
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions client/resource_group/controller/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ import (
"context"
"encoding/json"
"fmt"
"github.com/pingcap/log"
"go.uber.org/zap"
"io"
"math/rand"
"net/http"
Expand Down Expand Up @@ -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))
}

Expand Down

0 comments on commit 289af93

Please sign in to comment.