@@ -212,6 +212,9 @@ protected void createFile(final File file, final long size) throws IOException {
212212 } finally {
213213 IOUtils .closeQuietly (reader );
214214 }
215+ // sanity checks
216+ assertTrue (file .exists ());
217+ assertEquals (size , file .length ());
215218 }
216219
217220 @ Test
@@ -667,23 +670,23 @@ public void testTailerEndOfFileReached() throws Exception {
667670 @ Test
668671 public void testTailerEof () throws Exception {
669672 // Create & start the Tailer
670- final long delay = 50 ;
673+ final long delayMillis = 100 ;
671674 final File file = new File (temporaryFolder , "tailer2-test.txt" );
672675 createFile (file , 0 );
673676 final TestTailerListener listener = new TestTailerListener ();
674- try (Tailer tailer = new Tailer (file , listener , delay , false )) {
677+ try (Tailer tailer = new Tailer (file , listener , delayMillis , false )) {
675678 final Thread thread = new Thread (tailer );
676679 thread .start ();
677680
678681 // Write some lines to the file
679682 writeString (file , "Line" );
680683
681- TestUtils .sleep (delay * 2 );
684+ TestUtils .sleep (delayMillis * 2 );
682685 List <String > lines = listener .getLines ();
683686 assertEquals (0 , lines .size (), "1 line count" );
684687
685688 writeString (file , " one\n " );
686- TestUtils .sleep (delay * 2 );
689+ TestUtils .sleep (delayMillis * 2 );
687690 lines = listener .getLines ();
688691
689692 assertEquals (1 , lines .size (), "1 line count" );
0 commit comments