Skip to content

Commit

Permalink
fix: loadbalance unit test (#1270)
Browse files Browse the repository at this point in the history
* fix

* Fix
  • Loading branch information
LaurenceLiZhixin authored Jun 21, 2021
1 parent ca2a46f commit fc2cd0d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cluster/loadbalance/consistent_hash_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)
}

0 comments on commit fc2cd0d

Please sign in to comment.