(client testgrpc.TestServiceClient, timeout time.Duration)
| 55 | ) |
| 56 | |
| 57 | func doRPCAndGetPath(client testgrpc.TestServiceClient, timeout time.Duration) testpb.GrpclbRouteType { |
| 58 | infoLog.Printf("doRPCAndGetPath timeout:%v\n", timeout) |
| 59 | ctx, cancel := context.WithTimeout(context.Background(), timeout) |
| 60 | defer cancel() |
| 61 | req := &testpb.SimpleRequest{ |
| 62 | FillGrpclbRouteType: true, |
| 63 | } |
| 64 | reply, err := client.UnaryCall(ctx, req) |
| 65 | if err != nil { |
| 66 | infoLog.Printf("doRPCAndGetPath error:%v\n", err) |
| 67 | return testpb.GrpclbRouteType_GRPCLB_ROUTE_TYPE_UNKNOWN |
| 68 | } |
| 69 | g := reply.GetGrpclbRouteType() |
| 70 | infoLog.Printf("doRPCAndGetPath got grpclb route type: %v\n", g) |
| 71 | if g != testpb.GrpclbRouteType_GRPCLB_ROUTE_TYPE_FALLBACK && g != testpb.GrpclbRouteType_GRPCLB_ROUTE_TYPE_BACKEND { |
| 72 | errorLog.Fatalf("Expected grpclb route type to be either backend or fallback; got: %d", g) |
| 73 | } |
| 74 | return g |
| 75 | } |
| 76 | |
| 77 | func dialTCPUserTimeout(ctx context.Context, addr string) (net.Conn, error) { |
| 78 | control := func(_, _ string, c syscall.RawConn) error { |
no test coverage detected