m-trieu commented on code in PR #32774:
URL: https://github.com/apache/beam/pull/32774#discussion_r1841019493
##########
runners/google-cloud-dataflow-java/worker/src/test/java/org/apache/beam/runners/dataflow/worker/windmill/client/grpc/GrpcGetDataStreamTest.java:
##########
@@ -102,6 +105,48 @@ private GrpcGetDataStream
createGetDataStream(GetDataStreamTestStub testStub) {
return getDataStream;
}
+ @Test
+ public void testRequestKeyedData() {
+ GetDataStreamTestStub testStub =
+ new GetDataStreamTestStub(new TestGetDataStreamRequestObserver());
+ GrpcGetDataStream getDataStream = createGetDataStream(testStub);
+ // These will block until they are successfully sent.
+ CompletableFuture<Windmill.KeyedGetDataResponse> sendFuture =
+ CompletableFuture.supplyAsync(
+ () -> {
+ try {
+ return getDataStream.requestKeyedData(
+ "computationId",
+ Windmill.KeyedGetDataRequest.newBuilder()
+ .setKey(ByteString.EMPTY)
+ .setShardingKey(1)
+ .setCacheToken(1)
+ .setWorkToken(1)
+ .build());
+ } catch (WindmillStreamShutdownException e) {
+ throw new RuntimeException(e);
+ }
+ });
+
+ // Sleep a bit to allow future to run.
+ Uninterruptibles.sleepUninterruptibly(5, TimeUnit.SECONDS);
Review Comment:
done
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]