mirror of
https://github.com/zeromicro/go-zero.git
synced 2026-05-13 09:50:00 +08:00
feat: consistent hash balancer support (#5246)
Co-authored-by: 周曙光 <zsg@zhoushuguangdeMacBook-Pro.local>
This commit is contained in:
@@ -4,9 +4,11 @@ import (
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
zconf "github.com/zeromicro/go-zero/core/conf"
|
||||
"github.com/zeromicro/go-zero/core/discov"
|
||||
"github.com/zeromicro/go-zero/core/service"
|
||||
"github.com/zeromicro/go-zero/core/stores/redis"
|
||||
"github.com/zeromicro/go-zero/zrpc/internal/balancer/p2c"
|
||||
)
|
||||
|
||||
func TestRpcClientConf(t *testing.T) {
|
||||
@@ -39,6 +41,13 @@ func TestRpcClientConf(t *testing.T) {
|
||||
_, err := conf.BuildTarget()
|
||||
assert.Error(t, err)
|
||||
})
|
||||
|
||||
t.Run("default balancer name", func(t *testing.T) {
|
||||
var conf RpcClientConf
|
||||
err := zconf.FillDefault(&conf)
|
||||
assert.NoError(t, err)
|
||||
assert.Equal(t, p2c.Name, conf.BalancerName)
|
||||
})
|
||||
}
|
||||
|
||||
func TestRpcServerConf(t *testing.T) {
|
||||
|
||||
Reference in New Issue
Block a user