scwhittle commented on code in PR #26085:
URL: https://github.com/apache/beam/pull/26085#discussion_r1246939261
##########
runners/google-cloud-dataflow-java/worker/src/test/java/org/apache/beam/runners/dataflow/worker/FakeWindmillServer.java:
##########
@@ -273,7 +274,11 @@ public boolean awaitTermination(int time, TimeUnit unit)
throws InterruptedExcep
computationWork.getInputDataWatermark());
for (Windmill.WorkItem workItem : computationWork.getWorkList()) {
receiver.receiveWork(
- computationWork.getComputationId(), inputDataWatermark,
Instant.now(), workItem);
+ computationWork.getComputationId(),
+ inputDataWatermark,
+ Instant.now(),
+ workItem,
+ Collections.emptyList());
Review Comment:
can you have some way to configure the fake to pass a non-empty list for
attributions, so that we can verify that it is plumbed through to the commit?
Or alternatively always pass some latencies here, and then most of the
StreamingDataflowWorkerTests ignore it by filtering dynamic fields. And the
ones that don't can be updated to verify that it was kept.
##########
runners/google-cloud-dataflow-java/worker/src/test/java/org/apache/beam/runners/dataflow/worker/StreamingDataflowWorkerTest.java:
##########
@@ -3612,6 +3620,46 @@ public void testLatencyAttributionToCommittingState()
throws Exception {
.equals(Duration.millis(1000)));
}
+ @Test
+ public void testLatencyAttributionPopulatedInCommitRequest() throws
Exception {
+ final int workToken = 7272; // A unique id makes it easier to search logs.
+
+ FakeClock clock = new FakeClock();
+ List<ParallelInstruction> instructions =
+ Arrays.asList(
+ makeSourceInstruction(StringUtf8Coder.of()),
+ makeDoFnInstruction(
+ new FakeSlowDoFn(clock, Duration.millis(1000)), 0,
StringUtf8Coder.of()),
Review Comment:
nit: replace the 1000 with a constant that you use below when setting up
expectation. Will help make it clearer which two things should be equal
--
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]