mirror of https://github.com/grpc/grpc-java.git
gae-interop-testing: use ManagedChannelBuilder, abort if devserver (#3680)
Turns out the ManagedChannelBuilder was misbehaving because the devserver launcher ignores the app's jdk7 configuration and uses whatever jdk is in JAVA_HOME. This is the reason GrpcUtil.IS_RESTRICTED_APPENGINE was wrong. Changing JAVA_HOME to point to jdk7 reveals that devservers lack conscrypt. Adding an explicit check to make sure the jdk7 test is not running in a dev server.
This commit is contained in:
parent
6827f53785
commit
2d212646bc
|
|
@ -16,7 +16,11 @@
|
||||||
|
|
||||||
package io.grpc.testing.integration;
|
package io.grpc.testing.integration;
|
||||||
|
|
||||||
|
import static junit.framework.TestCase.assertEquals;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
import io.grpc.ManagedChannel;
|
import io.grpc.ManagedChannel;
|
||||||
|
import io.grpc.ManagedChannelBuilder;
|
||||||
import io.grpc.okhttp.OkHttpChannelBuilder;
|
import io.grpc.okhttp.OkHttpChannelBuilder;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
|
|
@ -131,9 +135,18 @@ public final class OkHttpClientInteropServlet extends HttpServlet {
|
||||||
public static final class Tester extends AbstractInteropTest {
|
public static final class Tester extends AbstractInteropTest {
|
||||||
@Override
|
@Override
|
||||||
protected ManagedChannel createChannel() {
|
protected ManagedChannel createChannel() {
|
||||||
OkHttpChannelBuilder builder =
|
assertEquals(
|
||||||
OkHttpChannelBuilder.forTarget(INTEROP_TEST_ADDRESS)
|
"jdk7 required",
|
||||||
|
"1.7",
|
||||||
|
System.getProperty("java.specification.version"));
|
||||||
|
assertEquals(
|
||||||
|
"Can not run in dev servers because they lack org.conscrypt.OpenSSLProvider support",
|
||||||
|
"Production",
|
||||||
|
System.getProperty("com.google.appengine.runtime.environment"));
|
||||||
|
ManagedChannelBuilder<?> builder =
|
||||||
|
ManagedChannelBuilder.forTarget(INTEROP_TEST_ADDRESS)
|
||||||
.maxInboundMessageSize(AbstractInteropTest.MAX_MESSAGE_SIZE);
|
.maxInboundMessageSize(AbstractInteropTest.MAX_MESSAGE_SIZE);
|
||||||
|
assertTrue(builder instanceof OkHttpChannelBuilder);
|
||||||
return builder.build();
|
return builder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,11 @@
|
||||||
|
|
||||||
package io.grpc.testing.integration;
|
package io.grpc.testing.integration;
|
||||||
|
|
||||||
|
import static org.junit.Assert.assertEquals;
|
||||||
|
import static org.junit.Assert.assertTrue;
|
||||||
|
|
||||||
import io.grpc.ManagedChannel;
|
import io.grpc.ManagedChannel;
|
||||||
|
import io.grpc.ManagedChannelBuilder;
|
||||||
import io.grpc.netty.NettyChannelBuilder;
|
import io.grpc.netty.NettyChannelBuilder;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
|
|
@ -79,11 +83,15 @@ public final class NettyClientInteropServlet extends HttpServlet {
|
||||||
public static final class Tester extends AbstractInteropTest {
|
public static final class Tester extends AbstractInteropTest {
|
||||||
@Override
|
@Override
|
||||||
protected ManagedChannel createChannel() {
|
protected ManagedChannel createChannel() {
|
||||||
NettyChannelBuilder builder =
|
assertEquals(
|
||||||
NettyChannelBuilder.forTarget(INTEROP_TEST_ADDRESS)
|
"jdk8 required",
|
||||||
|
"1.8",
|
||||||
|
System.getProperty("java.specification.version"));
|
||||||
|
ManagedChannelBuilder<?> builder =
|
||||||
|
ManagedChannelBuilder.forTarget(INTEROP_TEST_ADDRESS)
|
||||||
.maxInboundMessageSize(AbstractInteropTest.MAX_MESSAGE_SIZE);
|
.maxInboundMessageSize(AbstractInteropTest.MAX_MESSAGE_SIZE);
|
||||||
|
assertTrue(builder instanceof NettyChannelBuilder);
|
||||||
builder.flowControlWindow(65 * 1024);
|
((NettyChannelBuilder) builder).flowControlWindow(65 * 1024);
|
||||||
return builder.build();
|
return builder.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue