flume-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jar...@apache.org
Subject flume git commit: FLUME-2505: Test added in FLUME-2502 is flaky
Date Sat, 08 Nov 2014 20:10:39 GMT
Repository: flume
Updated Branches:
  refs/heads/trunk 29e31bfb5 -> 76ddc82fb


FLUME-2505: Test added in FLUME-2502 is flaky

(Hari Shreedharan via Jarek Jarcec Cecho)


Project: http://git-wip-us.apache.org/repos/asf/flume/repo
Commit: http://git-wip-us.apache.org/repos/asf/flume/commit/76ddc82f
Tree: http://git-wip-us.apache.org/repos/asf/flume/tree/76ddc82f
Diff: http://git-wip-us.apache.org/repos/asf/flume/diff/76ddc82f

Branch: refs/heads/trunk
Commit: 76ddc82fb829995f2c88976d4153de132edf0a20
Parents: 29e31bf
Author: Jarek Jarcec Cecho <jarcec@apache.org>
Authored: Sat Nov 8 12:09:49 2014 -0800
Committer: Jarek Jarcec Cecho <jarcec@apache.org>
Committed: Sat Nov 8 12:09:49 2014 -0800

----------------------------------------------------------------------
 .../flume/client/avro/TestReliableSpoolingFileEventReader.java | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flume/blob/76ddc82f/flume-ng-core/src/test/java/org/apache/flume/client/avro/TestReliableSpoolingFileEventReader.java
----------------------------------------------------------------------
diff --git a/flume-ng-core/src/test/java/org/apache/flume/client/avro/TestReliableSpoolingFileEventReader.java
b/flume-ng-core/src/test/java/org/apache/flume/client/avro/TestReliableSpoolingFileEventReader.java
index c6ff63e..476bbff 100644
--- a/flume-ng-core/src/test/java/org/apache/flume/client/avro/TestReliableSpoolingFileEventReader.java
+++ b/flume-ng-core/src/test/java/org/apache/flume/client/avro/TestReliableSpoolingFileEventReader.java
@@ -241,6 +241,7 @@ public class TestReliableSpoolingFileEventReader {
     File tempDir = Files.createTempDir();
     File tempFile = new File(tempDir, "t");
     File finalFile = new File(WORK_DIR, "t-file");
+    int totalFiles = WORK_DIR.listFiles().length;
     FileUtils.write(tempFile, "Last file");
     final Set<String> actual = Sets.newHashSet();
     ExecutorService executor = Executors.newSingleThreadExecutor();
@@ -257,6 +258,8 @@ public class TestReliableSpoolingFileEventReader {
     semaphore.acquire();
     tempFile.renameTo(finalFile);
     wait.get();
+    int listFilesCount = ((ReliableSpoolingFileEventReader)reader)
+      .getListFilesCount();
     finalFile.delete();
     FileUtils.deleteQuietly(tempDir);
     createExpectedFromFilesInSetup(expected);
@@ -264,8 +267,7 @@ public class TestReliableSpoolingFileEventReader {
     expected.add(
       "New file created in the end. Shoud be read randomly.");
     expected.add("Last file");
-    Assert.assertEquals(2, ((ReliableSpoolingFileEventReader)reader)
-      .getListFilesCount());
+    Assert.assertTrue(listFilesCount < (totalFiles + 2));
     Assert.assertEquals(expected, actual);
   }
 


Mime
View raw message