reswqa commented on code in PR #22864:
URL: https://github.com/apache/flink/pull/22864#discussion_r1242160848


##########
flink-streaming-java/src/test/java/org/apache/flink/streaming/api/graph/StreamingJobGraphGeneratorTest.java:
##########
@@ -304,6 +304,35 @@ void testTransformationSetMaxParallelism() {
                 .isEqualTo(20);
     }
 
+    /**
+     * Tests that the maxParallelism for an operator chain is correctly 
determined as the minimal
+     * maxParallelism of all operators in the chain.
+     */
+    @Test
+    void testTransformationSetMinimalMaxParallelismForChain() {
+        StreamExecutionEnvironment env = 
StreamExecutionEnvironment.getExecutionEnvironment();
+        env.setMaxParallelism(16);
+
+        DataStreamSource<Long> source = env.fromSequence(1L, 3L);
+        source.setParallelism(1)
+                .setMaxParallelism(128)
+                .map(i -> i)
+                .setParallelism(1)
+                .setMaxParallelism(1)
+                .print()
+                .setParallelism(1);
+
+        StreamGraph streamGraph = env.getStreamGraph();
+
+        List<JobVertex> vertices =
+                
streamGraph.getJobGraph().getVerticesSortedTopologicallyFromSources();
+
+        assertThat(vertices.size()).isEqualTo(1);

Review Comment:
   nit:
   ```suggestion
           assertThat(vertices).hasSize(1);
   ```



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