exceptionfactory commented on a change in pull request #5885:
URL: https://github.com/apache/nifi/pull/5885#discussion_r835532430



##########
File path: 
nifi-nar-bundles/nifi-standard-bundle/nifi-standard-processors/src/test/java/org/apache/nifi/processors/standard/TestListSFTP.java
##########
@@ -74,12 +82,14 @@ public void setUp() throws Exception {
     @After
     public void tearDown() throws Exception {
         sshServer.stopServer();
+        Files.deleteIfExists(Paths.get(sshServer.getVirtualFileSystemPath()));
     }
 
     @Test
-    public void testRunFileFound() {
+    public void testRunFileFound() throws InterruptedException {
+        writeTempFile(1);
+        Thread.sleep(STABILITY_WAIT);

Review comment:
       The `ListSFTP` processor includes a file filter that checks the minimum 
age based on the current system time in milliseconds. The 
`SFTPTransfer.newFileInfo()` method sets the last modified time, but apparently 
it only provides resolution to the second and includes a multiplication by 1000 
to get milliseconds. With the default minimum age set to zero seconds, this 
might explain the reason that the test sometimes misses files.
   
   With that background, another solution may be to set the minimum age to a 
negative number, or probably better, set the modified time on temporary files 
to something older than current time.




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