NIFI-1263: Windows considers last mod time on both rolled over files to be the same, due to the way that windows computes the lastMod time. On linux and os x it is done differently. This is easily solved by adding a small sleep to the unit test before 'rolling over' the file so that the last mod date is different on all OS's, which yields the same behavior on all OS's

This commit is contained in:
Mark Payne 2015-12-07 09:53:33 -05:00
parent f83e6d33c5
commit bd3fd870ac
1 changed files with 4 additions and 0 deletions

View File

@ -319,6 +319,8 @@ public class TestTailFile {
raf = new RandomAccessFile(file, "rw"); raf = new RandomAccessFile(file, "rw");
raf.write("abc\n".getBytes()); raf.write("abc\n".getBytes());
Thread.sleep(100L);
// rename file to log.1 // rename file to log.1
raf.close(); raf.close();
file.renameTo(new File("target/log.1")); file.renameTo(new File("target/log.1"));
@ -365,6 +367,8 @@ public class TestTailFile {
raf = new RandomAccessFile(file, "rw"); raf = new RandomAccessFile(file, "rw");
raf.write("abc\n".getBytes()); raf.write("abc\n".getBytes());
Thread.sleep(100L);
// rename file to log.1 // rename file to log.1
raf.close(); raf.close();
file.renameTo(new File("target/log.1")); file.renameTo(new File("target/log.1"));