Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Leung <[email protected]>
  • Loading branch information
rleungx committed Aug 27, 2024
1 parent b58a978 commit a2ed10c
Showing 1 changed file with 7 additions and 34 deletions.
41 changes: 7 additions & 34 deletions server/api/label_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,9 @@ import (
. "github.com/pingcap/check"
"github.com/pingcap/kvproto/pkg/metapb"
"github.com/pingcap/kvproto/pkg/pdpb"
<<<<<<< HEAD
=======
"github.com/stretchr/testify/suite"
"github.com/tikv/pd/pkg/core"
"github.com/tikv/pd/pkg/response"
tu "github.com/tikv/pd/pkg/utils/testutil"
>>>>>>> c8ad186c3 (server: skip the engine key when match store label (#8486))
"github.com/tikv/pd/server"
"github.com/tikv/pd/server/config"
"github.com/tikv/pd/server/core"
)

var _ = Suite(&testLabelsStoreSuite{})
Expand Down Expand Up @@ -297,32 +291,19 @@ func (s *testStrictlyLabelsStoreSuite) TestStoreMatch(c *C) {
_, err := s.grpcSvr.PutStore(context.Background(), &pdpb.PutStoreRequest{
Header: &pdpb.RequestHeader{ClusterId: s.svr.ClusterID()},
Store: &metapb.Store{
<<<<<<< HEAD
Id: t.store.Id,
Address: fmt.Sprintf("tikv%d", t.store.Id),
Address: t.store.Address,
State: t.store.State,
Labels: t.store.Labels,
Version: t.store.Version,
},
})
if t.valid {
c.Assert(err, IsNil)
=======
Id: testCase.store.Id,
Address: testCase.store.Address,
State: testCase.store.State,
Labels: testCase.store.Labels,
Version: testCase.store.Version,
},
})
if testCase.store.Address == "tiflash1" {
re.Contains(resp.GetHeader().GetError().String(), testCase.expectError)
if t.store.Address == "tiflash1" {
c.Assert(strings.Contains(err.Error(), t.expectError), IsTrue)
continue
}
if testCase.valid {
re.NoError(err)
re.Nil(resp.GetHeader().GetError())
>>>>>>> c8ad186c3 (server: skip the engine key when match store label (#8486))
if t.valid {
c.Assert(err, IsNil)
} else {
c.Assert(strings.Contains(err.Error(), t.expectError), IsTrue)
}
Expand All @@ -334,19 +315,11 @@ func (s *testStrictlyLabelsStoreSuite) TestStoreMatch(c *C) {
_, err := s.grpcSvr.PutStore(context.Background(), &pdpb.PutStoreRequest{
Header: &pdpb.RequestHeader{ClusterId: s.svr.ClusterID()},
Store: &metapb.Store{
<<<<<<< HEAD
Id: t.store.Id,
Address: fmt.Sprintf("tikv%d", t.store.Id),
Address: t.store.Address,
State: t.store.State,
Labels: t.store.Labels,
Version: t.store.Version,
=======
Id: testCase.store.Id,
Address: testCase.store.Address,
State: testCase.store.State,
Labels: testCase.store.Labels,
Version: testCase.store.Version,
>>>>>>> c8ad186c3 (server: skip the engine key when match store label (#8486))
},
})
if t.valid {
Expand Down

0 comments on commit a2ed10c

Please sign in to comment.