All, I'm working on unit tests for the ListFile processor but I've run into 2 problems that I can't resolve. For background, ListFile is a blatant (steal this code) ripoff of ListHDFS but using the filesystem instead of HDFS. My test class is cloned from TestListHDFS and the problem test parallels testNoListUntilUpdateFromRemoteOnPrimaryNodeChange() <https://github.com/apache/nifi/blob/master/nifi-nar-bundles/nifi-hadoop-bundle/nifi-hdfs-processors/src/test/java/org/apache/nifi/processors/hadoop/TestListHDFS.java#L145>. The test is supposed to works as follows.
1. Create tempFile1 2. Call processor run() and validate that 1 flow file processed is tempFile1 3. Call clearTransferState() to reset processor 4. Create tempFile2 5. Trigger primary node change 6. Disable cache service 7. Call processor run() and confirm that tempFile2 was NOT processed (while service is down) 8. Re-enable cache service 9. Call processor run() and validate that 1 flow file processed is tempFile2 So, the problems are: 1. After step #9, testFile1 and testFile2 flow files are returned, even though none were returned after step #3. 2. Even with a 2 second sleep after #3, the timestamp on tempFile1 and tempFile2 are the same, which may be contributing to issue #1. Any input appreciated. Regards, Joe
