chia7712 commented on a change in pull request #11169:
URL: https://github.com/apache/kafka/pull/11169#discussion_r702252480



##########
File path: 
connect/file/src/test/java/org/apache/kafka/connect/file/FileStreamSourceTaskTest.java
##########
@@ -220,12 +220,12 @@ public void testMissingFile() throws InterruptedException 
{
         task.stop();
     }
 
+    @Test
     public void testInvalidFile() throws InterruptedException {
+        replay();

Review comment:
       pardon me. why it needs to call `replay()`?

##########
File path: 
connect/file/src/test/java/org/apache/kafka/connect/file/FileStreamSourceTaskTest.java
##########
@@ -220,12 +220,12 @@ public void testMissingFile() throws InterruptedException 
{
         task.stop();
     }
 
+    @Test
     public void testInvalidFile() throws InterruptedException {
+        replay();
         config.put(FileStreamSourceConnector.FILE_CONFIG, "bogusfilename");
         task.start(config);
-        // Currently the task retries indefinitely if the file isn't found, 
but shouldn't return any data.
-        for (int i = 0; i < 100; i++)
-            assertNull(task.poll());
+        assertNull(task.poll());

Review comment:
       How about calling the `poll` again to make sure it does not cause error?




-- 
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: jira-unsubscr...@kafka.apache.org

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


Reply via email to