1u0 commented on a change in pull request #8742: [FLINK-11879] Add validators 
for the uses of InputSelectable, BoundedOneInput and BoundedMultiInput
URL: https://github.com/apache/flink/pull/8742#discussion_r302899171
 
 

 ##########
 File path: 
flink-streaming-java/src/test/java/org/apache/flink/streaming/api/graph/StreamingJobGraphGeneratorTest.java
 ##########
 @@ -673,4 +682,87 @@ public void testBlockingConnectionsBetweenChainsEnabled() 
{
                assertEquals(ResultPartitionType.PIPELINED_BOUNDED, 
filterAndMapVertex.getProducedDataSets().get(0).getResultType());
                assertEquals(ResultPartitionType.PIPELINED_BOUNDED, 
printVertex.getInputs().get(0).getSource().getResultType());
        }
+
+       @Test
+       public void testOperatorNotSupportedByCheckpointing() {
+
+               // test the operator which implements InputSelectable
+               try {
+                       StreamExecutionEnvironment env = 
StreamExecutionEnvironment.getExecutionEnvironment();
+                       env.enableCheckpointing(60_000L);
+
+                       DataStreamSource<String> source1 = 
env.fromElements("1");
+                       DataStreamSource<Integer> source2 = env.fromElements(1);
+                       source1.connect(source2)
+                               .transform("test",
+                                       BasicTypeInfo.STRING_TYPE_INFO,
+                                       new 
TestAnyModeReadingStreamOperator("test operator"))
+                               .print();
+
+                       
StreamingJobGraphGenerator.createJobGraph(env.getStreamGraph());
 
 Review comment:
   What about refactoring this test, by extracting building a sample job graph 
(with operator under the test as a parameter) via a helper method and also, 
splitting the test into three separate tests?
   
   If they run separately, you can also use simpler structure
   ```
   @Test(expected = UnsupportedOperationException.class)
   public void testValidationForOperator...() throws Exception {
       // setup graph:
       ...
       StreamingJobGraphGenerator.createJobGraph(env.getStreamGraph());
       fail("unreachable");
   }
   

----------------------------------------------------------------
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:
[email protected]


With regards,
Apache Git Services

Reply via email to