zhuzhurk commented on a change in pull request #14868:
URL: https://github.com/apache/flink/pull/14868#discussion_r583373862



##########
File path: 
flink-runtime/src/test/java/org/apache/flink/runtime/executiongraph/PointwisePatternTest.java
##########
@@ -330,19 +206,45 @@ private void testHighToLow(int highDop, int lowDop) 
throws Exception {
         final int factor = highDop / lowDop;
         final int delta = highDop % lowDop == 0 ? 0 : 1;
 
+        ExecutionJobVertex target = setUpExecutionGraph(highDop, lowDop);
+
+        int[] timesUsed = new int[highDop];
+
+        for (ExecutionVertex ev : target.getTaskVertices()) {
+            assertEquals(1, ev.getNumberOfInputs());
+
+            List<IntermediateResultPartitionID> consumedPartitions =
+                    ev.getAllConsumedPartitions().stream()
+                            .map(ConsumedPartitionGroup::getResultPartitions)
+                            .flatMap(Collection::stream)
+                            .collect(Collectors.toList());
+            assertTrue(
+                    consumedPartitions.size() >= factor
+                            && consumedPartitions.size() <= factor + delta);
+
+            for (IntermediateResultPartitionID consumedPartition : 
consumedPartitions) {
+                timesUsed[consumedPartition.getPartitionNumber()]++;
+            }
+        }
+        for (int used : timesUsed) {
+            assertEquals(1, used);
+        }
+    }
+
+    private ExecutionJobVertex setUpExecutionGraph(int upstream, int 
downstream) throws Exception {

Review comment:
       maybe `setUpExecutionGraph` -> 
`setUpExecutionGraphAndGetDownstreamVertex`?




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

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to