Skip to content
Snippets Groups Projects
Unverified Commit fc2cd0d2 authored by Laurence's avatar Laurence Committed by GitHub
Browse files

fix: loadbalance unit test (#1270)

* fix

* Fix
parent ca2a46f8
No related branches found
Tags v3.0.0-rc2
No related merge requests found
......@@ -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)
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment