mirror of https://github.com/apache/nifi.git
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:
parent
f83e6d33c5
commit
bd3fd870ac
|
@ -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"));
|
||||||
|
|
Loading…
Reference in New Issue