fluo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ktur...@apache.org
Subject [1/2] incubator-fluo git commit: fixes #762 improve how test waits for propogation of oldest timestamp
Date Tue, 25 Oct 2016 22:18:54 GMT
Repository: incubator-fluo
Updated Branches:
  refs/heads/master d99a6e0fa -> 389d00700


fixes #762 improve how test waits for propogation of oldest timestamp


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

Branch: refs/heads/master
Commit: 2bf94b1d4b9a69cb55acd49259aac68b0b210c7f
Parents: 1d243c3
Author: Keith Turner <kturner@apache.org>
Authored: Tue Oct 25 17:27:44 2016 -0400
Committer: Keith Turner <kturner@apache.org>
Committed: Tue Oct 25 17:27:44 2016 -0400

----------------------------------------------------------------------
 .../apache/fluo/integration/impl/CollisionIT.java | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-fluo/blob/2bf94b1d/modules/integration/src/test/java/org/apache/fluo/integration/impl/CollisionIT.java
----------------------------------------------------------------------
diff --git a/modules/integration/src/test/java/org/apache/fluo/integration/impl/CollisionIT.java
b/modules/integration/src/test/java/org/apache/fluo/integration/impl/CollisionIT.java
index 8639fbc..3af4fdc 100644
--- a/modules/integration/src/test/java/org/apache/fluo/integration/impl/CollisionIT.java
+++ b/modules/integration/src/test/java/org/apache/fluo/integration/impl/CollisionIT.java
@@ -42,7 +42,9 @@ import org.apache.fluo.core.util.UtilWaitThread;
 import org.apache.fluo.integration.ITBaseMini;
 import org.apache.fluo.integration.TestUtil;
 import org.junit.Assert;
+import org.junit.Rule;
 import org.junit.Test;
+import org.junit.rules.Timeout;
 
 /**
  * Run end to end test with lots of collisions and verify the following :
@@ -61,6 +63,9 @@ public class CollisionIT extends ITBaseMini {
   private static final Column STAT_CHANGED = new Column("stat", "changed");
   private static final Column STAT_PROCESSED = new Column("stat", "processed");
 
+  @Rule
+  public Timeout globalTimeout = Timeout.seconds(60);
+
   private static class NumLoader implements Loader {
 
     int num;
@@ -130,6 +135,8 @@ public class CollisionIT extends ITBaseMini {
 
     miniFluo.waitForObservers();
 
+    long recentTS;
+
     try (Snapshot snapshot = client.newSnapshot()) {
 
       for (int i = 0; i < expectedCounts.length; i++) {
@@ -144,16 +151,15 @@ public class CollisionIT extends ITBaseMini {
       String allTotal = snapshot.gets("all", STAT_TOTAL);
       Assert.assertNotNull(allTotal);
       Assert.assertEquals(1000, Integer.parseInt(allTotal));
+
+      recentTS = snapshot.getStartTimestamp();
     }
 
     long oldestTS = ZookeeperUtil.getGcTimestamp(config.getAppZookeepers());
-    while (true) {
+
+    while (oldestTS < recentTS) {
       UtilWaitThread.sleep(300);
-      long tmp = ZookeeperUtil.getGcTimestamp(config.getAppZookeepers());
-      if (oldestTS == tmp) {
-        break;
-      }
-      oldestTS = tmp;
+      oldestTS = ZookeeperUtil.getGcTimestamp(config.getAppZookeepers());
     }
 
     conn.tableOperations().compact(getCurTableName(), null, null, true, true);


Mime
View raw message