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

Function startManualResolverWithConfig

balancer/rls/helpers_test.go:192–205  ·  view source on GitHub ↗

startManualResolverWithConfig registers and returns a manual resolver which pushes the RLS LB policy's service config on the channel.

(t *testing.T, rlsConfig *e2e.RLSConfig)

Source from the content-addressed store, hash-verified

190// startManualResolverWithConfig registers and returns a manual resolver which
191// pushes the RLS LB policy's service config on the channel.
192func startManualResolverWithConfig(t *testing.T, rlsConfig *e2e.RLSConfig) *manual.Resolver {
193 t.Helper()
194
195 scJSON, err := rlsConfig.ServiceConfigJSON()
196 if err != nil {
197 t.Fatal(err)
198 }
199
200 sc := internal.ParseServiceConfig.(func(string) *serviceconfig.ParseResult)(scJSON)
201 r := manual.NewBuilderWithScheme("rls-e2e")
202 r.InitialState(resolver.State{ServiceConfig: sc})
203 t.Cleanup(r.Close)
204 return r
205}
206
207// makeTestRPCAndExpectItToReachBackend is a test helper function which makes
208// the EmptyCall RPC on the given ClientConn and verifies that it reaches a

Calls 4

NewBuilderWithSchemeFunction · 0.92
ServiceConfigJSONMethod · 0.80
InitialStateMethod · 0.80
FatalMethod · 0.65

Tested by

no test coverage detected