From 456fa937f0401c96a3cf783ad1507e2e801b1e66 Mon Sep 17 00:00:00 2001 From: JmPotato Date: Mon, 5 Aug 2024 17:26:08 +0800 Subject: [PATCH] This is an automated cherry-pick of #8490 close tikv/pd#8491, ref pingcap/tidb#55188 Signed-off-by: ti-chi-bot --- client/http/interface.go | 2 +- tests/integrations/client/http_client_test.go | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/client/http/interface.go b/client/http/interface.go index 7b15291d9e7..75c858df19f 100644 --- a/client/http/interface.go +++ b/client/http/interface.go @@ -672,7 +672,7 @@ func (c *client) GetRegionLabelRulesByIDs(ctx context.Context, ruleIDs []string) var labelRules []*LabelRule err = c.request(ctx, newRequestInfo(). WithName(getRegionLabelRulesByIDsName). - WithURI(RegionLabelRules). + WithURI(RegionLabelRulesByIDs). WithMethod(http.MethodGet). WithBody(idsJSON). WithResp(&labelRules)) diff --git a/tests/integrations/client/http_client_test.go b/tests/integrations/client/http_client_test.go index 9efbc587847..94c3194f3e9 100644 --- a/tests/integrations/client/http_client_test.go +++ b/tests/integrations/client/http_client_test.go @@ -451,7 +451,15 @@ func (suite *httpClientTestSuite) checkRegionLabel(mode mode, client pd.Client) re.Equal(labelRule.ID, allLabelRules[1].ID) re.Equal(labelRule.Labels, allLabelRules[1].Labels) re.Equal(labelRule.RuleType, allLabelRules[1].RuleType) +<<<<<<< HEAD labelRules, err = client.GetRegionLabelRulesByIDs(env.ctx, []string{"keyspaces/0", "rule2"}) +======= + labelRules, err = client.GetRegionLabelRulesByIDs(ctx, []string{"rule2"}) + re.NoError(err) + re.Len(labelRules, 1) + re.Equal(labelRule, labelRules[0]) + labelRules, err = client.GetRegionLabelRulesByIDs(ctx, []string{"keyspaces/0", "rule2"}) +>>>>>>> 838ee7983 (client/http: fix the URI of GetRegionLabelRulesByIDs (#8490)) re.NoError(err) sort.Slice(labelRules, func(i, j int) bool { return labelRules[i].ID < labelRules[j].ID