acrites commented on code in PR #40639:
URL: https://github.com/apache/beam/pull/40639#discussion_r4669559020


##########
runners/google-cloud-dataflow-java/worker/src/test/java/org/apache/beam/runners/dataflow/worker/util/common/worker/MapTaskExecutorTest.java:
##########
@@ -580,4 +584,40 @@ public void testExceptionAndThenCloseAbortsJustOnce() 
throws Exception {
     // Closing after already closed should not call abort again.
     executor.close();
   }
+
+  @Test
+  public void testGetParDoOperations() throws Exception {
+    TestOutputReceiver receiver =
+        new TestOutputReceiver(counterSet, 
NameContextsForTests.nameContextForTest());
+    ReadOperation readOp = new TestReadOperation(receiver, 
createContext("ReadOperation"));
+    OutputReceiver reportingReceiver1 = new OutputReceiver();
+    OutputReceiver reportingReceiver2 = new OutputReceiver();
+    ParDoOperation regularParDo =
+        new ParDoOperation(
+            new NoopParDoFn(), new OutputReceiver[0], 
createContext("RegularParDo"), null);
+    ParDoOperation reportingParDo1 =
+        new ParDoOperation(
+            new NoopParDoFn(),
+            new OutputReceiver[] {reportingReceiver1},
+            createContext("ReportingParDo1"),
+            ImmutableMap.of(reportingReceiver1, StringUtf8Coder.of()));
+    ParDoOperation reportingParDo2 =
+        new ParDoOperation(
+            new NoopParDoFn(),
+            new OutputReceiver[] {reportingReceiver2},
+            createContext("ReportingParDo2"),
+            ImmutableMap.of(reportingReceiver2, VarIntCoder.of()));
+
+    List<Operation> operations =
+        Arrays.asList(readOp, regularParDo, reportingParDo1, reportingParDo2);
+    ExecutionStateTracker stateTracker = ExecutionStateTracker.newForTest();
+    try (MapTaskExecutor executor = new MapTaskExecutor(operations, 
counterSet, stateTracker)) {
+      List<ParDoOperation> parDoOps = executor.getParDoOperations();
+      assertThat(parDoOps, contains(regularParDo, reportingParDo1, 
reportingParDo2));

Review Comment:
   Yeah, it includes the order. The unordered version is `containsInAnyOrder`.



-- 
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]

Reply via email to