rkhachatryan commented on a change in pull request #10435: 
[FLINK-13955][runtime] migrate ContinuousFileReaderOperator to the mailbox 
execution model
URL: https://github.com/apache/flink/pull/10435#discussion_r371387764
 
 

 ##########
 File path: 
flink-fs-tests/src/test/java/org/apache/flink/hdfstests/ContinuousFileProcessingTest.java
 ##########
 @@ -166,21 +171,21 @@ public void testFileReadingOperatorWithIngestionTime() 
throws Exception {
                final long watermarkInterval = 10;
 
                ContinuousFileReaderOperator<String> reader = new 
ContinuousFileReaderOperator<>(format);
-               final 
OneInputStreamOperatorTestHarness<TimestampedFileInputSplit, String> tester =
-                       new OneInputStreamOperatorTestHarness<>(reader);
+               final 
OneInputStreamOperatorTestHarness<TimestampedFileInputSplit, String> tester = 
getTester(reader);
 
                
tester.getExecutionConfig().setAutoWatermarkInterval(watermarkInterval);
                tester.setTimeCharacteristic(TimeCharacteristic.IngestionTime);
                reader.setOutputType(typeInfo, tester.getExecutionConfig());
 
-               tester.open();
+               tester.getTaskMailbox().put(new Mail(tester::open, 0, ""));
 
                Assert.assertEquals(TimeCharacteristic.IngestionTime, 
tester.getTimeCharacteristic());
 
                // test that watermarks are correctly emitted
 
                ConcurrentLinkedQueue<Object> output = tester.getOutput();
 
+               Thread.sleep(1000);
 
 Review comment:
   This is to wait for input to be processed.
   Replacing with
   ```
   while (output.isEmpty()) {
        Thread.sleep(50);
   }
   ```
   Latches would work, but make the test and harness too complex.
   I think that the ideal solution would be to introduce some form of 
listener/controller into the Operator. But I think that with FLIP-27 it won't 
be necessary.

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


With regards,
Apache Git Services

Reply via email to