(t *testing.T)
| 506 | } |
| 507 | |
| 508 | func (s) TestDisableServiceConfigOption(t *testing.T) { |
| 509 | r := manual.NewBuilderWithScheme("whatever") |
| 510 | addr := r.Scheme() + ":///non.existent" |
| 511 | cc, err := NewClient(addr, WithTransportCredentials(insecure.NewCredentials()), WithResolvers(r), WithDisableServiceConfig()) |
| 512 | if err != nil { |
| 513 | t.Fatalf("grpc.NewClient(%s) failed: %v, want: nil", addr, err) |
| 514 | } |
| 515 | defer cc.Close() |
| 516 | cc.Connect() |
| 517 | r.UpdateState(resolver.State{ServiceConfig: r.CC().ParseServiceConfig(`{ |
| 518 | "methodConfig": [ |
| 519 | { |
| 520 | "name": [ |
| 521 | { |
| 522 | "service": "foo", |
| 523 | "method": "Bar" |
| 524 | } |
| 525 | ], |
| 526 | "waitForReady": true |
| 527 | } |
| 528 | ] |
| 529 | }`)}) |
| 530 | time.Sleep(1 * time.Second) |
| 531 | m := cc.GetMethodConfig("/foo/Bar") |
| 532 | if m.WaitForReady != nil { |
| 533 | t.Fatalf("want: method (\"/foo/bar/\") config to be empty, got: %+v", m) |
| 534 | } |
| 535 | } |
| 536 | |
| 537 | func (s) TestMethodConfigDefaultService(t *testing.T) { |
| 538 | addr := "passthrough:///non.existent" |
nothing calls this directly
no test coverage detected