From a2ed10cdd8a1c9afe3842f1a694dd91cc4a5359b Mon Sep 17 00:00:00 2001 From: Ryan Leung Date: Tue, 27 Aug 2024 16:41:54 +0800 Subject: [PATCH] fix Signed-off-by: Ryan Leung --- server/api/label_test.go | 41 +++++++--------------------------------- 1 file changed, 7 insertions(+), 34 deletions(-) diff --git a/server/api/label_test.go b/server/api/label_test.go index 3d330603f44..cbb2d213d32 100644 --- a/server/api/label_test.go +++ b/server/api/label_test.go @@ -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{}) @@ -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) } @@ -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 {