From 62f4399e26a074d80c78ad5abc72d90afa1f33d5 Mon Sep 17 00:00:00 2001 From: Jakob Buchgraber Date: Wed, 18 Feb 2015 12:11:11 -0800 Subject: [PATCH] Add 10s timeouts to integration tests --- .../integration/AbstractTransportTest.java | 26 +++++++++---------- .../java/io/grpc/stub/StubConfigTest.java | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/integration-testing/src/main/java/io/grpc/testing/integration/AbstractTransportTest.java b/integration-testing/src/main/java/io/grpc/testing/integration/AbstractTransportTest.java index 6559fdceb6..bbb93c79b9 100644 --- a/integration-testing/src/main/java/io/grpc/testing/integration/AbstractTransportTest.java +++ b/integration-testing/src/main/java/io/grpc/testing/integration/AbstractTransportTest.java @@ -131,12 +131,12 @@ public abstract class AbstractTransportTest { protected abstract ChannelImpl createChannel(); - @Test + @Test(timeout = 10000) public void emptyUnary() throws Exception { assertEquals(Empty.getDefaultInstance(), blockingStub.emptyCall(Empty.getDefaultInstance())); } - @Test + @Test(timeout = 10000) public void largeUnary() throws Exception { final SimpleRequest request = SimpleRequest.newBuilder() .setResponseSize(314159) @@ -153,7 +153,7 @@ public abstract class AbstractTransportTest { assertEquals(goldenResponse, blockingStub.unaryCall(request)); } - @Test + @Test(timeout = 10000) public void serverStreaming() throws Exception { final StreamingOutputCallRequest request = StreamingOutputCallRequest.newBuilder() .setResponseType(PayloadType.COMPRESSABLE) @@ -195,7 +195,7 @@ public abstract class AbstractTransportTest { assertEquals(goldenResponses, recorder.getValues()); } - @Test + @Test(timeout = 10000) public void clientStreaming() throws Exception { final List requests = Arrays.asList( StreamingInputCallRequest.newBuilder() @@ -228,7 +228,7 @@ public abstract class AbstractTransportTest { assertEquals(goldenResponse, responseObserver.firstValue().get()); } - @Test(timeout=5000) + @Test(timeout = 10000) public void pingPong() throws Exception { final List requests = Arrays.asList( StreamingOutputCallRequest.newBuilder() @@ -291,7 +291,7 @@ public abstract class AbstractTransportTest { verifyNoMoreInteractions(responseObserver); } - @Test + @Test(timeout = 10000) public void emptyStream() throws Exception { @SuppressWarnings("unchecked") StreamObserver responseObserver = mock(StreamObserver.class); @@ -302,7 +302,7 @@ public abstract class AbstractTransportTest { verifyNoMoreInteractions(responseObserver); } - @Test + @Test(timeout = 10000) public void cancelAfterBegin() throws Exception { StreamRecorder responseObserver = StreamRecorder.create(); StreamObserver requestObserver = @@ -313,7 +313,7 @@ public abstract class AbstractTransportTest { assertEquals(Status.CANCELLED, Status.fromThrowable(responseObserver.getError())); } - @Test + @Test(timeout = 10000) public void cancelAfterFirstResponse() throws Exception { final StreamingOutputCallRequest request = StreamingOutputCallRequest.newBuilder() .addResponseParameters(ResponseParameters.newBuilder() @@ -342,7 +342,7 @@ public abstract class AbstractTransportTest { verifyNoMoreInteractions(responseObserver); } - @Test + @Test(timeout = 10000) public void fullDuplexCallShouldSucceed() throws Exception { // Build the request. List responseSizes = Arrays.asList(50, 100, 150, 200); @@ -375,7 +375,7 @@ public abstract class AbstractTransportTest { } } - @Test + @Test(timeout = 10000) public void halfDuplexCallShouldSucceed() throws Exception { // Build the request. List responseSizes = Arrays.asList(50, 100, 150, 200); @@ -407,7 +407,7 @@ public abstract class AbstractTransportTest { } } - @Test + @Test(timeout = 10000) public void streamingOutputShouldBeFlowControlled() throws Exception { // Create the call object. Call call = @@ -476,7 +476,7 @@ public abstract class AbstractTransportTest { } } - @org.junit.Test + @Test(timeout = 10000) public void exchangeContextUnaryCall() throws Exception { TestServiceGrpc.TestServiceBlockingStub stub = TestServiceGrpc.newBlockingStub(channel); @@ -500,7 +500,7 @@ public abstract class AbstractTransportTest { Assert.assertEquals(contextValue, trailersCapture.get().get(METADATA_KEY)); } - @org.junit.Test + @Test(timeout = 10000) public void exchangeContextStreamingCall() throws Exception { TestServiceGrpc.TestServiceStub stub = TestServiceGrpc.newStub(channel); diff --git a/integration-testing/src/test/java/io/grpc/stub/StubConfigTest.java b/integration-testing/src/test/java/io/grpc/stub/StubConfigTest.java index 1456c550de..9ed900c1fd 100644 --- a/integration-testing/src/test/java/io/grpc/stub/StubConfigTest.java +++ b/integration-testing/src/test/java/io/grpc/stub/StubConfigTest.java @@ -50,7 +50,7 @@ import java.util.concurrent.TimeUnit; @RunWith(JUnit4.class) public class StubConfigTest { - @Test + @Test(timeout = 10000) public void testConfigureTimeout() { // Create a default stub TestServiceGrpc.TestServiceBlockingStub stub =