curator-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From randg...@apache.org
Subject curator git commit: use Timing
Date Wed, 09 Sep 2015 06:35:46 GMT
Repository: curator
Updated Branches:
  refs/heads/CURATOR-3.0 793ed89b1 -> 520fc2c99


use Timing


Project: http://git-wip-us.apache.org/repos/asf/curator/repo
Commit: http://git-wip-us.apache.org/repos/asf/curator/commit/520fc2c9
Tree: http://git-wip-us.apache.org/repos/asf/curator/tree/520fc2c9
Diff: http://git-wip-us.apache.org/repos/asf/curator/diff/520fc2c9

Branch: refs/heads/CURATOR-3.0
Commit: 520fc2c9976767910317ebf5037386d43ca93005
Parents: 793ed89
Author: randgalt <randgalt@apache.org>
Authored: Wed Sep 9 01:35:38 2015 -0500
Committer: randgalt <randgalt@apache.org>
Committed: Wed Sep 9 01:35:38 2015 -0500

----------------------------------------------------------------------
 .../apache/curator/framework/imps/TestReconfiguration.java  | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/520fc2c9/curator-framework/src/test/java/org/apache/curator/framework/imps/TestReconfiguration.java
----------------------------------------------------------------------
diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestReconfiguration.java
b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestReconfiguration.java
index 133e690..2438ef8 100644
--- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestReconfiguration.java
+++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestReconfiguration.java
@@ -29,6 +29,7 @@ import org.apache.curator.framework.ensemble.EnsembleTracker;
 import org.apache.curator.retry.RetryOneTime;
 import org.apache.curator.test.InstanceSpec;
 import org.apache.curator.test.TestingCluster;
+import org.apache.curator.test.Timing;
 import org.apache.curator.utils.CloseableUtils;
 import org.apache.zookeeper.data.Stat;
 import org.apache.zookeeper.server.quorum.flexible.QuorumMaj;
@@ -43,12 +44,12 @@ import java.util.HashMap;
 import java.util.Map;
 import java.util.Properties;
 import java.util.concurrent.CountDownLatch;
-import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 import java.util.concurrent.atomic.AtomicReference;
 
 public class TestReconfiguration
 {
+    private static final Timing timing = new Timing();
     private TestingCluster cluster;
     private DynamicEnsembleProvider dynamicEnsembleProvider;
     private WaitOnDelegateListener waitOnDelegateListener;
@@ -157,7 +158,7 @@ public class TestReconfiguration
 
         CountDownLatch latch = new CountDownLatch(1);
         client.getConfig().inBackground(callback, latch).forEnsemble();
-        latch.await(5, TimeUnit.SECONDS);
+        Assert.assertTrue(timing.awaitLatch(latch));
         Assert.assertNotNull(bytes.get());
         QuorumVerifier qv = getQuorumVerifier(bytes.get());
         Assert.assertEquals(qv.getAllMembers().size(), 5);
@@ -274,7 +275,7 @@ public class TestReconfiguration
 
         CountDownLatch latch = new CountDownLatch(1);
         client.getConfig().inBackground(callback, latch).forEnsemble();
-        latch.await(5, TimeUnit.SECONDS);
+        Assert.assertTrue(timing.awaitLatch(latch));
         Assert.assertNotNull(bytes.get());
         QuorumVerifier qv = getQuorumVerifier(bytes.get());
         Assert.assertEquals(qv.getAllMembers().size(), 5);
@@ -404,7 +405,7 @@ public class TestReconfiguration
 
         public void waitForEvent() throws InterruptedException, TimeoutException
         {
-            if ( latch.await(5, TimeUnit.SECONDS) )
+            if ( timing.awaitLatch(latch) )
             {
                 latch = new CountDownLatch(1);
             }


Mime
View raw message