Skip to content

Commit 63358ea

Browse files
committed
interop-testing: timeoutOnSleepingServer should fail on exception
This is ancient code, but our API should not throw IllegalStateException in the case of races. This essentially reverts 0958fd4. The stream code has changed a lot since this code was introduced, but at the very least the replacement of AbstractStream that culminated in b661ac7 means the bug is almost certainly gone. I ran Http2Test 1000 times and there were no failures.
1 parent 1ef5ee2 commit 63358ea

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

interop-testing/src/main/java/io/grpc/testing/integration/AbstractInteropTest.java

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,7 +1625,6 @@ public void unimplementedService() {
16251625
}
16261626

16271627
/** Start a fullDuplexCall which the server will not respond, and verify the deadline expires. */
1628-
@SuppressWarnings("MissingFail")
16291628
@Test
16301629
public void timeoutOnSleepingServer() throws Exception {
16311630
TestServiceGrpc.TestServiceStub stub =
@@ -1635,15 +1634,10 @@ public void timeoutOnSleepingServer() throws Exception {
16351634
StreamObserver<StreamingOutputCallRequest> requestObserver
16361635
= stub.fullDuplexCall(responseObserver);
16371636

1638-
StreamingOutputCallRequest request = StreamingOutputCallRequest.newBuilder()
1637+
requestObserver.onNext(StreamingOutputCallRequest.newBuilder()
16391638
.setPayload(Payload.newBuilder()
16401639
.setBody(ByteString.copyFrom(new byte[27182])))
1641-
.build();
1642-
try {
1643-
requestObserver.onNext(request);
1644-
} catch (IllegalStateException expected) {
1645-
// This can happen if the stream has already been terminated due to deadline exceeded.
1646-
}
1640+
.build());
16471641

16481642
assertTrue(responseObserver.awaitCompletion(operationTimeoutMillis(), TimeUnit.MILLISECONDS));
16491643
assertEquals(0, responseObserver.getValues().size());

0 commit comments

Comments
 (0)