From 020325617129b6ae9b25da1126ba0f98b044bb1b Mon Sep 17 00:00:00 2001 From: Eric Anderson Date: Thu, 8 Oct 2020 10:38:29 -0700 Subject: [PATCH] interop-testing: Avoid alts incompatibility with netty alts requires netty-shaded, not netty. --- .../grpc/testing/integration/TestServiceClient.java | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/interop-testing/src/main/java/io/grpc/testing/integration/TestServiceClient.java b/interop-testing/src/main/java/io/grpc/testing/integration/TestServiceClient.java index 32bd31e315..d94213526d 100644 --- a/interop-testing/src/main/java/io/grpc/testing/integration/TestServiceClient.java +++ b/interop-testing/src/main/java/io/grpc/testing/integration/TestServiceClient.java @@ -396,9 +396,10 @@ public class TestServiceClient { private class Tester extends AbstractInteropTest { @Override protected ManagedChannelBuilder createChannelBuilder() { + boolean useGeneric = false; ChannelCredentials channelCredentials; if (customCredentialsType != null) { - useOkHttp = false; // Retain old behavior; avoids erroring if incompatible + useGeneric = true; // Retain old behavior; avoids erroring if incompatible if (customCredentialsType.equals("google_default_credentials")) { channelCredentials = GoogleDefaultChannelCredentials.create(); } else if (customCredentialsType.equals("compute_engine_channel_creds")) { @@ -409,7 +410,7 @@ public class TestServiceClient { } } else if (useAlts) { - useOkHttp = false; // Retain old behavior; avoids erroring if incompatible + useGeneric = true; // Retain old behavior; avoids erroring if incompatible channelCredentials = AltsChannelCredentials.create(); } else if (useTls) { @@ -442,6 +443,14 @@ public class TestServiceClient { channelCredentials = InsecureChannelCredentials.create(); } } + if (useGeneric) { + ManagedChannelBuilder channelBuilder = + Grpc.newChannelBuilderForAddress(serverHost, serverPort, channelCredentials); + if (serverHostOverride != null) { + channelBuilder.overrideAuthority(serverHostOverride); + } + return channelBuilder; + } if (!useOkHttp) { NettyChannelBuilder nettyBuilder = NettyChannelBuilder.forAddress(serverHost, serverPort, channelCredentials)