From fc2cd0d2ddb55c43328381eef024bfca51fdf4ee Mon Sep 17 00:00:00 2001 From: Laurence <45508533+LaurenceLiZhixin@users.noreply.github.com> Date: Mon, 21 Jun 2021 14:29:57 +0800 Subject: [PATCH] fix: loadbalance unit test (#1270) * fix * Fix --- cluster/loadbalance/consistent_hash_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/cluster/loadbalance/consistent_hash_test.go b/cluster/loadbalance/consistent_hash_test.go index e349e843c9..72848b55e5 100644 --- a/cluster/loadbalance/consistent_hash_test.go +++ b/cluster/loadbalance/consistent_hash_test.go @@ -36,7 +36,7 @@ import ( const ( ip = "192.168.1.0" port8080 = 8080 - port8082 = 8082 + port8081 = 8081 url8080Short = "dubbo://192.168.1.0:8080" url8081Short = "dubbo://192.168.1.0:8081" @@ -114,9 +114,9 @@ func (s *consistentHashLoadBalanceSuite) SetupTest() { func (s *consistentHashLoadBalanceSuite) TestSelect() { args := []interface{}{"name", "password", "age"} invoker := s.lb.Select(s.invokers, invocation.NewRPCInvocation("echo", args, nil)) - s.Equal(invoker.GetURL().Location, fmt.Sprintf("%s:%d", ip, port8080)) + s.Equal(fmt.Sprintf("%s:%d", ip, port8081), invoker.GetURL().Location) args = []interface{}{"ok", "abc"} invoker = s.lb.Select(s.invokers, invocation.NewRPCInvocation("echo", args, nil)) - s.Equal(invoker.GetURL().Location, fmt.Sprintf("%s:%d", ip, port8082)) + s.Equal(fmt.Sprintf("%s:%d", ip, port8080), invoker.GetURL().Location) }