Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
Signed-off-by: husharp <jinhao.hu@pingcap.com>
  • Loading branch information
HuSharp committed Jul 13, 2023
1 parent 242132e commit 2db9f9a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 19 deletions.
3 changes: 1 addition & 2 deletions client/resource_group/controller/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import (
"os"
"time"

"github.com/cloudfoundry/gosigar"
sigar "github.com/cloudfoundry/gosigar"
"go.uber.org/zap"

rmpb "github.com/pingcap/kvproto/pkg/resource_manager"
Expand All @@ -37,7 +37,6 @@ type RequestInfo interface {
WriteBytes() uint64
ReplicaNumber() int64
StoreID() uint64
RequestSource() string
}

// ResponseInfo is the interface of the response information provider. A response should be
Expand Down
10 changes: 0 additions & 10 deletions client/resource_group/controller/testutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,6 @@ func (tri *TestRequestInfo) ReplicaNumber() int64 {
return 1
}

// RequestSource implements the RequestInfo interface.
func (tri *TestRequestInfo) RequestSource() string {
return tri.requestSource
}

// SetRequestSource set the request source.
func (tri *TestRequestInfo) SetRequestSource(requestSource string) {
tri.requestSource = requestSource
}

// TestResponseInfo is used to test the response info interface.
type TestResponseInfo struct {
readBytes uint64
Expand Down
10 changes: 3 additions & 7 deletions tests/integrations/mcs/resourcemanager/resource_manager_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1165,15 +1165,11 @@ func (suite *resourceManagerClientTestSuite) TestSkipConsumptionForBackgroundJob
c.Start(suite.ctx)

resourceGroupName := suite.initGroups[1].Name
req := controller.NewTestRequestInfo(false, 0, 1)
re.False(c.IsBackgroundRequest(suite.ctx, resourceGroupName, req.RequestSource()))
re.False(c.IsBackgroundRequest(suite.ctx, resourceGroupName, "internal_default"))

resourceGroupName = "background_job"
req.SetRequestSource("internal_br")
re.True(c.IsBackgroundRequest(suite.ctx, resourceGroupName, req.RequestSource()))

req.SetRequestSource("internal_lightning")
re.True(c.IsBackgroundRequest(suite.ctx, resourceGroupName, req.RequestSource()))
re.True(c.IsBackgroundRequest(suite.ctx, resourceGroupName, "internal_br"))
re.True(c.IsBackgroundRequest(suite.ctx, resourceGroupName, "internal_lightning"))

c.Stop()
}

0 comments on commit 2db9f9a

Please sign in to comment.