You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@curator.apache.org by ra...@apache.org on 2014/05/23 17:07:14 UTC

[13/29] git commit: Added more timing to tests

Added more timing to tests


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

Branch: refs/heads/CURATOR-105
Commit: de71564cfbda114dbf87cbaa4af96f074354675a
Parents: 0ba5de3
Author: randgalt <ra...@apache.org>
Authored: Thu May 15 14:32:29 2014 -0500
Committer: randgalt <ra...@apache.org>
Committed: Thu May 15 14:32:29 2014 -0500

----------------------------------------------------------------------
 .../recipes/locks/TestInterProcessSemaphore.java  | 18 ++++++++++--------
 1 file changed, 10 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/de71564c/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphore.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphore.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphore.java
index e3e75a1..f6956ff 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphore.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphore.java
@@ -117,8 +117,8 @@ public class TestInterProcessSemaphore extends BaseClassForTests
         InterProcessSemaphoreV2 semaphore2;
         try
         {
-            client1 = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1));
-            client2 = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1));
+            client1 = CuratorFrameworkFactory.newClient(server.getConnectString(), timing.session(), timing.connection(), new RetryOneTime(1));
+            client2 = CuratorFrameworkFactory.newClient(server.getConnectString(), timing.session(), timing.connection(), new RetryOneTime(1));
 
             client1.start();
             client2.start();
@@ -270,7 +270,7 @@ public class TestInterProcessSemaphore extends BaseClassForTests
                         @Override
                         public Object call() throws Exception
                         {
-                            CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1));
+                            CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), timing.session(), timing.connection(), new RetryOneTime(1));
                             client.start();
                             try
                             {
@@ -324,7 +324,7 @@ public class TestInterProcessSemaphore extends BaseClassForTests
         final int MAX_LEASES = 11;
         final int THREADS = 100;
 
-        final CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1));
+        final CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), timing.session(), timing.connection(), new RetryOneTime(1));
         client.start();
         try
         {
@@ -390,6 +390,7 @@ public class TestInterProcessSemaphore extends BaseClassForTests
                 completionService.take();
             }
 
+            timing.sleepABit();
             synchronized(counter)
             {
                 Assert.assertTrue(counter.currentCount == 0);
@@ -409,7 +410,7 @@ public class TestInterProcessSemaphore extends BaseClassForTests
     {
         final int THREAD_QTY = 10;
 
-        CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1));
+        CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), timing.session(), timing.connection(), new RetryOneTime(1));
         client.start();
         try
         {
@@ -451,7 +452,7 @@ public class TestInterProcessSemaphore extends BaseClassForTests
     public void testSimple() throws Exception
     {
         Timing timing = new Timing();
-        CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1));
+        CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), timing.session(), timing.connection(), new RetryOneTime(1));
         client.start();
         try
         {
@@ -471,7 +472,7 @@ public class TestInterProcessSemaphore extends BaseClassForTests
         final int MAX_LEASES = 3;
         Timing timing = new Timing();
 
-        CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1));
+        CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), timing.session(), timing.connection(), new RetryOneTime(1));
         client.start();
         try
         {
@@ -502,7 +503,8 @@ public class TestInterProcessSemaphore extends BaseClassForTests
     {
         final int LEASES = 3;
 
-        CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1));
+        Timing timing = new Timing();
+        CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), timing.session(), timing.connection(), new RetryOneTime(1));
         client.start();
         try
         {