You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2021/09/19 17:03:40 UTC
[commons-io] branch master updated: Trying to fix random failures
on GitHub builds.
This is an automated email from the ASF dual-hosted git repository.
ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-io.git
The following commit(s) were added to refs/heads/master by this push:
new 940cc16 Trying to fix random failures on GitHub builds.
940cc16 is described below
commit 940cc1632242810d3aeafa534da43e50188cec27
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Sun Sep 19 13:03:36 2021 -0400
Trying to fix random failures on GitHub builds.
---
src/test/java/org/apache/commons/io/input/TailerTest.java | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/src/test/java/org/apache/commons/io/input/TailerTest.java b/src/test/java/org/apache/commons/io/input/TailerTest.java
index 6ce918e..a220c35 100644
--- a/src/test/java/org/apache/commons/io/input/TailerTest.java
+++ b/src/test/java/org/apache/commons/io/input/TailerTest.java
@@ -212,6 +212,9 @@ public class TailerTest {
} finally {
IOUtils.closeQuietly(reader);
}
+ // sanity checks
+ assertTrue(file.exists());
+ assertEquals(size, file.length());
}
@Test
@@ -667,23 +670,23 @@ public class TailerTest {
@Test
public void testTailerEof() throws Exception {
// Create & start the Tailer
- final long delay = 50;
+ final long delayMillis = 100;
final File file = new File(temporaryFolder, "tailer2-test.txt");
createFile(file, 0);
final TestTailerListener listener = new TestTailerListener();
- try (Tailer tailer = new Tailer(file, listener, delay, false)) {
+ try (Tailer tailer = new Tailer(file, listener, delayMillis, false)) {
final Thread thread = new Thread(tailer);
thread.start();
// Write some lines to the file
writeString(file, "Line");
- TestUtils.sleep(delay * 2);
+ TestUtils.sleep(delayMillis * 2);
List<String> lines = listener.getLines();
assertEquals(0, lines.size(), "1 line count");
writeString(file, " one\n");
- TestUtils.sleep(delay * 2);
+ TestUtils.sleep(delayMillis * 2);
lines = listener.getLines();
assertEquals(1, lines.size(), "1 line count");