(ctx context.Context)
| 257 | } |
| 258 | |
| 259 | func (te *test) clientConn(ctx context.Context) *grpc.ClientConn { |
| 260 | if te.cc != nil { |
| 261 | return te.cc |
| 262 | } |
| 263 | opts := []grpc.DialOption{ |
| 264 | grpc.WithTransportCredentials(insecure.NewCredentials()), |
| 265 | grpc.WithUserAgent("test/0.0.1"), |
| 266 | } |
| 267 | if te.compress == "gzip" { |
| 268 | opts = append(opts, |
| 269 | grpc.WithCompressor(grpc.NewGZIPCompressor()), |
| 270 | grpc.WithDecompressor(grpc.NewGZIPDecompressor()), |
| 271 | ) |
| 272 | } |
| 273 | for _, sh := range te.clientStatsHandlers { |
| 274 | opts = append(opts, grpc.WithStatsHandler(sh)) |
| 275 | } |
| 276 | |
| 277 | var err error |
| 278 | te.cc, err = grpc.NewClient(te.srvAddr, opts...) |
| 279 | if err != nil { |
| 280 | te.t.Fatalf("grpc.NewClient(%q) failed: %v", te.srvAddr, err) |
| 281 | } |
| 282 | te.cc.Connect() |
| 283 | testutils.AwaitState(ctx, te.t, te.cc, connectivity.Ready) |
| 284 | return te.cc |
| 285 | } |
| 286 | |
| 287 | type rpcType int |
| 288 |
no test coverage detected