MCPcopy
hub / github.com/grpc/grpc-go / setup

Function setup

internal/xds/balancer/outlierdetection/balancer_test.go:84–95  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

82}
83
84func setup(t *testing.T) (*outlierDetectionBalancer, *testutils.BalancerClientConn, func()) {
85 t.Helper()
86 builder := balancer.Get(Name)
87 if builder == nil {
88 t.Fatalf("balancer.Get(%q) returned nil", Name)
89 }
90 tcc := testutils.NewBalancerClientConn(t)
91 ch := channelz.RegisterChannel(nil, "test channel")
92 t.Cleanup(func() { channelz.RemoveEntry(ch.ID) })
93 odB := builder.Build(tcc, balancer.BuildOptions{ChannelzParent: ch})
94 return odB.(*outlierDetectionBalancer), tcc, odB.Close
95}
96
97type emptyChildConfig struct {
98 serviceconfig.LoadBalancingConfig

Calls 6

GetFunction · 0.92
NewBalancerClientConnFunction · 0.92
RegisterChannelFunction · 0.92
RemoveEntryFunction · 0.92
FatalfMethod · 0.65
BuildMethod · 0.65

Tested by

no test coverage detected