Skip to content

Commit cc5a06b

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 cc5a06b

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

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

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1635,15 +1635,10 @@ public void timeoutOnSleepingServer() throws Exception {
16351635
StreamObserver<StreamingOutputCallRequest> requestObserver
16361636
= stub.fullDuplexCall(responseObserver);
16371637

1638-
StreamingOutputCallRequest request = StreamingOutputCallRequest.newBuilder()
1638+
requestObserver.onNext(StreamingOutputCallRequest.newBuilder()
16391639
.setPayload(Payload.newBuilder()
16401640
.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-
}
1641+
.build());
16471642

16481643
assertTrue(responseObserver.awaitCompletion(operationTimeoutMillis(), TimeUnit.MILLISECONDS));
16491644
assertEquals(0, responseObserver.getValues().size());

0 commit comments

Comments
 (0)