Skip to content

added gRPC DNS balancing test #1722

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions balancers/balancers.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,16 @@ func RandomChoice() *balancerConfig.Config {
return &balancerConfig.Config{}
}

func SingleConn() *balancerConfig.Config {
func NoDiscovery() *balancerConfig.Config {
return &balancerConfig.Config{
SingleConn: true,
NoDiscovery: true,
}
}

func SingleConn() *balancerConfig.Config {
return NoDiscovery()
}

type filterLocalDC struct{}

func (filterLocalDC) Allow(info balancerConfig.Info, e endpoint.Info) bool {
Expand Down
6 changes: 3 additions & 3 deletions balancers/config_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,19 @@ func TestFromConfig(t *testing.T) {
{
name: "disable",
config: `disable`,
res: balancerConfig.Config{SingleConn: true},
res: balancerConfig.Config{NoDiscovery: true},
},
{
name: "single",
config: `single`,
res: balancerConfig.Config{SingleConn: true},
res: balancerConfig.Config{NoDiscovery: true},
},
{
name: "single/JSON",
config: `{
"type": "single"
}`,
res: balancerConfig.Config{SingleConn: true},
res: balancerConfig.Config{NoDiscovery: true},
},
{
name: "round_robin",
Expand Down
Loading
Loading