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

Function parseServiceConfig

balancer/pickfirst/pickfirst_ext_test.go:93–101  ·  view source on GitHub ↗

parseServiceConfig is a test helper which uses the manual resolver to parse the given service config. It calls t.Fatal() if service config parsing fails.

(t *testing.T, r *manual.Resolver, sc string)

Source from the content-addressed store, hash-verified

91// parseServiceConfig is a test helper which uses the manual resolver to parse
92// the given service config. It calls t.Fatal() if service config parsing fails.
93func parseServiceConfig(t *testing.T, r *manual.Resolver, sc string) *serviceconfig.ParseResult {
94 t.Helper()
95
96 scpr := r.CC().ParseServiceConfig(sc)
97 if scpr.Err != nil {
98 t.Fatalf("Failed to parse service config %q: %v", sc, scpr.Err)
99 }
100 return scpr
101}
102
103// setupPickFirst performs steps required for pick_first tests. It starts a
104// bunch of backends exporting the TestService, creates a ClientConn to them

Calls 3

CCMethod · 0.80
ParseServiceConfigMethod · 0.65
FatalfMethod · 0.65

Tested by

no test coverage detected