(t *testing.T, c *clientConfig)
| 168 | } |
| 169 | |
| 170 | func setupClient(t *testing.T, c *clientConfig) (*grpc.ClientConn, *manual.Resolver) { |
| 171 | t.Helper() |
| 172 | |
| 173 | r := manual.NewBuilderWithScheme("whatever") |
| 174 | opts := []grpc.DialOption{ |
| 175 | grpc.WithTransportCredentials(insecure.NewCredentials()), |
| 176 | grpc.WithResolvers(r), |
| 177 | } |
| 178 | if c != nil { |
| 179 | if c.balancerName != "" { |
| 180 | opts = append(opts, grpc.WithDefaultServiceConfig(fmt.Sprintf(`{"loadBalancingConfig": [{"%s":{}}]}`, c.balancerName))) |
| 181 | } |
| 182 | opts = append(opts, c.extraDialOption...) |
| 183 | } |
| 184 | |
| 185 | cc, err := grpc.NewClient(r.Scheme()+":///test.server", opts...) |
| 186 | if err != nil { |
| 187 | t.Fatalf("grpc.NewClient() failed: %v", err) |
| 188 | } |
| 189 | cc.Connect() |
| 190 | t.Cleanup(func() { cc.Close() }) |
| 191 | return cc, r |
| 192 | } |
| 193 | |
| 194 | func (s) TestHealthCheckWatchStateChange(t *testing.T) { |
| 195 | _, lis, ts := setupServer(t, nil) |
no test coverage detected