Return-Path: X-Original-To: apmail-curator-commits-archive@minotaur.apache.org Delivered-To: apmail-curator-commits-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 22BCA11371 for ; Fri, 23 May 2014 15:07:03 +0000 (UTC) Received: (qmail 7944 invoked by uid 500); 23 May 2014 15:07:03 -0000 Delivered-To: apmail-curator-commits-archive@curator.apache.org Received: (qmail 7864 invoked by uid 500); 23 May 2014 15:07:03 -0000 Mailing-List: contact commits-help@curator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@curator.apache.org Delivered-To: mailing list commits@curator.apache.org Received: (qmail 7669 invoked by uid 99); 23 May 2014 15:07:02 -0000 Received: from tyr.zones.apache.org (HELO tyr.zones.apache.org) (140.211.11.114) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 23 May 2014 15:07:02 +0000 Received: by tyr.zones.apache.org (Postfix, from userid 65534) id B34A99A47B8; Fri, 23 May 2014 15:07:02 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: randgalt@apache.org To: commits@curator.apache.org Date: Fri, 23 May 2014 15:07:14 -0000 Message-Id: <2d31ec92ae1d402f9774f20c4c80aea7@git.apache.org> In-Reply-To: <4c52c9a752f84f3cb1c1fa8c60e52b3d@git.apache.org> References: <4c52c9a752f84f3cb1c1fa8c60e52b3d@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [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 Authored: Thu May 15 14:32:29 2014 -0500 Committer: randgalt 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 {