curator-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From randg...@apache.org
Subject [1/7] git commit: Use a more reasonable retry for better test reliability
Date Sun, 10 Nov 2013 02:48:09 GMT
Updated Branches:
  refs/heads/CURATOR-72 [created] d8df3b13d


Use a more reasonable retry for better test reliability


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

Branch: refs/heads/CURATOR-72
Commit: aea4dd88236c44c84adc24457e84cd3eb474a0db
Parents: 987430a
Author: randgalt <randgalt@apache.org>
Authored: Sat Nov 9 18:43:26 2013 -0800
Committer: randgalt <randgalt@apache.org>
Committed: Sat Nov 9 18:43:26 2013 -0800

----------------------------------------------------------------------
 .../recipes/locks/TestInterProcessMutexBase.java      | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/aea4dd88/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessMutexBase.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessMutexBase.java
b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessMutexBase.java
index 73b530c..249f36c 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessMutexBase.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessMutexBase.java
@@ -132,7 +132,7 @@ public abstract class TestInterProcessMutexBase extends BaseClassForTests
     {
         final Timing timing = new Timing();
 
-        CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(),
timing.session(), timing.connection(), new RetryOneTime(1));
+        CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(),
timing.session(), timing.connection(), new ExponentialBackoffRetry(100, 3));
         client.start();
         try
         {
@@ -186,7 +186,7 @@ public abstract class TestInterProcessMutexBase extends BaseClassForTests
     {
         CuratorFramework client = CuratorFrameworkFactory.builder().
             connectString(server.getConnectString()).
-            retryPolicy(new RetryOneTime(1)).
+            retryPolicy(new ExponentialBackoffRetry(100, 3)).
             namespace("test").
             build();
         client.start();
@@ -208,7 +208,7 @@ public abstract class TestInterProcessMutexBase extends BaseClassForTests
     {
         final int THREAD_QTY = 10;
 
-        CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(),
new RetryOneTime(1));
+        CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(),
new ExponentialBackoffRetry(100, 3));
         client.start();
         try
         {
@@ -272,7 +272,7 @@ public abstract class TestInterProcessMutexBase extends BaseClassForTests
     @Test
     public void testReentrant2Threads() throws Exception
     {
-        CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(),
new RetryOneTime(1));
+        CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(),
new ExponentialBackoffRetry(100, 3));
         client.start();
         try
         {
@@ -318,7 +318,7 @@ public abstract class TestInterProcessMutexBase extends BaseClassForTests
     @Test
     public void testReentrant() throws Exception
     {
-        CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(),
new RetryOneTime(1));
+        CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(),
new ExponentialBackoffRetry(100, 3));
         client.start();
         try
         {
@@ -370,8 +370,8 @@ public abstract class TestInterProcessMutexBase extends BaseClassForTests
         CuratorFramework client2 = null;
         try
         {
-            client1 = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1));
-            client2 = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1));
+            client1 = CuratorFrameworkFactory.newClient(server.getConnectString(), new ExponentialBackoffRetry(100,
3));
+            client2 = CuratorFrameworkFactory.newClient(server.getConnectString(), new ExponentialBackoffRetry(100,
3));
             client1.start();
             client2.start();
 


Mime
View raw message