Skip to content

Commit 2ac2d47

Browse files
committed
Closing the stream after the rpc is done.
1 parent efce818 commit 2ac2d47

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

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

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1106,6 +1106,7 @@ public void testMcs() throws Exception {
11061106
Object responseObj = responseObserver1.take();
11071107
StreamingOutputCallResponse callResponse = (StreamingOutputCallResponse) responseObj;
11081108
String clientSocketAddressInCall1 = new String(callResponse.getPayload().getBody().toByteArray());
1109+
assertThat(clientSocketAddressInCall1).isNotEmpty();
11091110

11101111
StreamingOutputCallResponseObserver responseObserver2 = new StreamingOutputCallResponseObserver();
11111112
StreamObserver<StreamingOutputCallRequest> streamObserver2 =
@@ -1126,14 +1127,13 @@ public void testMcs() throws Exception {
11261127
String clientSocketAddressInCall3 = new String(callResponse.getPayload().getBody().toByteArray());
11271128

11281129
assertThat(clientSocketAddressInCall3).isNotEqualTo(clientSocketAddressInCall1);
1129-
}
11301130

1131-
public void testMcs_serverStreaming() throws Exception {
1132-
StreamingOutputCallRequest request = StreamingOutputCallRequest.newBuilder()
1133-
.addResponseParameters(ResponseParameters.newBuilder().setSize(1).build()).build();
1134-
StreamingOutputCallResponseObserver responseObserver1 = new StreamingOutputCallResponseObserver();
1135-
asyncStub.streamingOutputCall(request, responseObserver1);
1136-
assertThat(responseObserver1.take()).isInstanceOf(StreamingOutputCallResponse.class);
1131+
streamObserver1.onCompleted();
1132+
assertThat(responseObserver1.isCompleted).isTrue();
1133+
streamObserver2.onCompleted();
1134+
assertThat(responseObserver2.isCompleted).isTrue();
1135+
streamObserver3.onCompleted();
1136+
assertThat(responseObserver3.isCompleted).isTrue();
11371137
}
11381138

11391139
}

0 commit comments

Comments
 (0)