incubator-s4-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mmo...@apache.org
Subject [4/7] git commit: minor fix for regression tests - wait for results file to be available
Date Wed, 12 Sep 2012 16:36:37 GMT
minor fix for regression tests
- wait for results file to be available


Project: http://git-wip-us.apache.org/repos/asf/incubator-s4/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-s4/commit/dd96e879
Tree: http://git-wip-us.apache.org/repos/asf/incubator-s4/tree/dd96e879
Diff: http://git-wip-us.apache.org/repos/asf/incubator-s4/diff/dd96e879

Branch: refs/heads/dev-old
Commit: dd96e8794820ebe29c750641b2c6cbcbd294193f
Parents: bac25cb
Author: Matthieu Morel <mmorel@apache.org>
Authored: Tue Jan 31 12:52:41 2012 +0100
Committer: Matthieu Morel <mmorel@apache.org>
Committed: Tue Jan 31 12:52:41 2012 +0100

----------------------------------------------------------------------
 .../apache/s4/ft/wordcount/FTWordCountTest.java    |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-s4/blob/dd96e879/s4-core/src/test/java/org/apache/s4/ft/wordcount/FTWordCountTest.java
----------------------------------------------------------------------
diff --git a/s4-core/src/test/java/org/apache/s4/ft/wordcount/FTWordCountTest.java b/s4-core/src/test/java/org/apache/s4/ft/wordcount/FTWordCountTest.java
index 37a68d1..f3c0f55 100644
--- a/s4-core/src/test/java/org/apache/s4/ft/wordcount/FTWordCountTest.java
+++ b/s4-core/src/test/java/org/apache/s4/ft/wordcount/FTWordCountTest.java
@@ -151,6 +151,12 @@ public class FTWordCountTest extends S4TestCase {
         signalTextProcessed.await(10, TimeUnit.SECONDS);
         File results = new File(S4TestCase.DEFAULT_TEST_OUTPUT_DIR
                 + File.separator + "wordcount");
+        if (!results.exists()) {
+        	// in case the results file isn't ready yet
+        	Thread.sleep(1000);
+        	results = new File(S4TestCase.DEFAULT_TEST_OUTPUT_DIR
+                    + File.separator + "wordcount");
+        }
         String s = TestUtils.readFile(results);
         Assert.assertEquals("be=2;da=2;doobie=5;not=1;or=1;to=2;", s);
 


Mime
View raw message