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 2018/12/09 22:50:21 UTC

[1/6] curator git commit: Merge branch 'CURATOR-491' into CURATOR-490

Repository: curator
Updated Branches:
  refs/heads/master 964f11abb -> a17d3af9a


Merge branch 'CURATOR-491' into CURATOR-490


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

Branch: refs/heads/master
Commit: 85161ab33b36e2f42b00bd4c27d158f8183f2835
Parents: d7774c4 49d08cc
Author: randgalt <ra...@apache.org>
Authored: Sat Dec 8 23:06:31 2018 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sat Dec 8 23:06:31 2018 -0500

----------------------------------------------------------------------
 .../recipes/cache/PathChildrenCache.java        | 29 ++++++++++++++++----
 1 file changed, 23 insertions(+), 6 deletions(-)
----------------------------------------------------------------------



[2/6] curator git commit: CURATOR-490

Posted by ra...@apache.org.
CURATOR-490

Various changes to make tests run better: using Timing object in TestCleanState and few tests where it was missing; set the exclude groups in zk34, and set retry tests as status skip


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

Branch: refs/heads/master
Commit: 4c993572f01e1368bd6898cf1fc6ab3eb59d8688
Parents: 85161ab
Author: randgalt <ra...@apache.org>
Authored: Sat Dec 8 23:15:44 2018 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sat Dec 8 23:15:44 2018 -0500

----------------------------------------------------------------------
 .../org/apache/curator/framework/imps/TestCleanState.java    | 4 +++-
 .../org/apache/curator/framework/imps/TestFramework.java     | 3 ++-
 .../apache/curator/framework/imps/TestFrameworkEdges.java    | 4 ++--
 .../curator/framework/recipes/cache/TestNodeCache.java       | 8 +++++---
 .../framework/recipes/cache/TestPathChildrenCache.java       | 2 +-
 curator-test-zk34/pom.xml                                    | 3 ++-
 .../main/java/org/apache/curator/test/BaseClassForTests.java | 1 +
 7 files changed, 16 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/4c993572/curator-framework/src/test/java/org/apache/curator/framework/imps/TestCleanState.java
----------------------------------------------------------------------
diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestCleanState.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestCleanState.java
index 7a61eea..d80e053 100644
--- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestCleanState.java
+++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestCleanState.java
@@ -20,6 +20,7 @@ package org.apache.curator.framework.imps;
 
 import org.apache.curator.framework.CuratorFramework;
 import org.apache.curator.test.WatchersDebug;
+import org.apache.curator.test.compatibility.Timing2;
 import org.apache.curator.utils.CloseableUtils;
 import org.apache.curator.utils.Compatibility;
 import org.apache.zookeeper.ZooKeeper;
@@ -42,6 +43,7 @@ public class TestCleanState
 
         try
         {
+            Timing2 timing = new Timing2();
             CuratorFrameworkImpl internalClient = (CuratorFrameworkImpl)client;
             EnsembleTracker ensembleTracker = internalClient.getEnsembleTracker();
             if ( ensembleTracker != null )
@@ -60,7 +62,7 @@ public class TestCleanState
                 {
                     if ( i > 0 )
                     {
-                        Thread.sleep(500);
+                        timing.multiple(.5).sleepABit();
                     }
                     boolean isLast = (i + 1) == maxLoops;
                     if ( WatchersDebug.getChildWatches(zooKeeper).size() != 0 )

http://git-wip-us.apache.org/repos/asf/curator/blob/4c993572/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFramework.java
----------------------------------------------------------------------
diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFramework.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFramework.java
index 0a01679..fe49ad7 100644
--- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFramework.java
+++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFramework.java
@@ -32,6 +32,7 @@ import org.apache.curator.retry.RetryOneTime;
 import org.apache.curator.test.BaseClassForTests;
 import org.apache.curator.test.Timing;
 import org.apache.curator.test.compatibility.Timing2;
+import org.apache.curator.test.compatibility.Zk35MethodInterceptor;
 import org.apache.curator.utils.CloseableUtils;
 import org.apache.curator.utils.EnsurePath;
 import org.apache.curator.utils.ZKPaths;
@@ -76,7 +77,7 @@ public class TestFramework extends BaseClassForTests
         super.teardown();
     }
 
-    @Test
+    @Test(groups = Zk35MethodInterceptor.zk35Group)
     public void testWaitForShutdownTimeoutMs() throws Exception
     {
         final BlockingQueue<Integer> timeoutQueue = new ArrayBlockingQueue<>(1);

http://git-wip-us.apache.org/repos/asf/curator/blob/4c993572/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java
----------------------------------------------------------------------
diff --git a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java
index f9b16af..0d832f1 100644
--- a/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java
+++ b/curator-framework/src/test/java/org/apache/curator/framework/imps/TestFrameworkEdges.java
@@ -696,7 +696,7 @@ public class TestFrameworkEdges extends BaseClassForTests
                 }
             }).start();
 
-            Thread.sleep(20L);
+            timing.sleepABit();
             try
             {
                 client2.delete().forPath("/parent/child" + (childCount / 2));
@@ -713,7 +713,7 @@ public class TestFrameworkEdges extends BaseClassForTests
                 }
             }
 
-            Assert.assertTrue(countDownLatch.await(10, TimeUnit.SECONDS));
+            Assert.assertTrue(timing.awaitLatch(countDownLatch));
 
             Assert.assertNull(client2.checkExists().forPath("/parent"));
         }

http://git-wip-us.apache.org/repos/asf/curator/blob/4c993572/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestNodeCache.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestNodeCache.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestNodeCache.java
index 2e81034..253c777 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestNodeCache.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestNodeCache.java
@@ -21,6 +21,7 @@ package org.apache.curator.framework.recipes.cache;
 import org.apache.curator.framework.imps.TestCleanState;
 import org.apache.curator.test.BaseClassForTests;
 import org.apache.curator.test.compatibility.KillSession2;
+import org.apache.curator.test.compatibility.Timing2;
 import org.apache.curator.utils.CloseableUtils;
 import org.apache.curator.framework.CuratorFramework;
 import org.apache.curator.framework.CuratorFrameworkFactory;
@@ -106,6 +107,7 @@ public class TestNodeCache extends BaseClassForTests
     @Test
     public void     testRebuildAgainstOtherProcesses() throws Exception
     {
+        Timing2                 timing2 = new Timing2();
         NodeCache               cache = null;
         final CuratorFramework  client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1));
         client.start();
@@ -138,7 +140,7 @@ public class TestNodeCache extends BaseClassForTests
                     @Override
                     public Object call() throws Exception
                     {
-                        finalCache.rebuildTestExchanger.exchange(new Object(), 10, TimeUnit.SECONDS);
+                        finalCache.rebuildTestExchanger.exchange(new Object(), timing2.forWaiting().seconds(), TimeUnit.SECONDS);
 
                         // simulate another process updating the node while we're rebuilding
                         client.setData().forPath("/test/snafu", "other".getBytes());
@@ -146,7 +148,7 @@ public class TestNodeCache extends BaseClassForTests
                         ChildData       currentData = finalCache.getCurrentData();
                         Assert.assertNotNull(currentData);
 
-                        finalCache.rebuildTestExchanger.exchange(new Object(), 10, TimeUnit.SECONDS);
+                        finalCache.rebuildTestExchanger.exchange(new Object(), timing2.forWaiting().seconds(), TimeUnit.SECONDS);
 
                         return null;
                     }
@@ -155,7 +157,7 @@ public class TestNodeCache extends BaseClassForTests
             cache.start(false);
             future.get();
 
-            Assert.assertTrue(latch.await(10, TimeUnit.SECONDS));
+            Assert.assertTrue(timing2.awaitLatch(latch));
             Assert.assertNotNull(cache.getCurrentData());
             Assert.assertEquals(cache.getCurrentData().getData(), "other".getBytes());
         }

http://git-wip-us.apache.org/repos/asf/curator/blob/4c993572/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestPathChildrenCache.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestPathChildrenCache.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestPathChildrenCache.java
index d2f8cc0..edaac37 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestPathChildrenCache.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/cache/TestPathChildrenCache.java
@@ -56,6 +56,7 @@ public class TestPathChildrenCache extends BaseClassForTests
         try
         {
             client.start();
+            client.blockUntilConnected();   // avoid PathChildrenCache connected events
 
             final BlockingQueue<PathChildrenCacheEvent.Type> events = Queues.newLinkedBlockingQueue();
             PathChildrenCacheListener listener = new PathChildrenCacheListener()
@@ -68,7 +69,6 @@ public class TestPathChildrenCache extends BaseClassForTests
             };
             cache.getListenable().addListener(listener);
             cache.start(PathChildrenCache.StartMode.POST_INITIALIZED_EVENT);
-            Assert.assertEquals(events.poll(timing.forWaiting().milliseconds(), TimeUnit.MILLISECONDS), PathChildrenCacheEvent.Type.CONNECTION_RECONNECTED);
             Assert.assertEquals(events.poll(timing.forWaiting().milliseconds(), TimeUnit.MILLISECONDS), PathChildrenCacheEvent.Type.INITIALIZED);
 
             client.create().forPath("/a/b/test/one");

http://git-wip-us.apache.org/repos/asf/curator/blob/4c993572/curator-test-zk34/pom.xml
----------------------------------------------------------------------
diff --git a/curator-test-zk34/pom.xml b/curator-test-zk34/pom.xml
index ff063d4..c2c74fa 100644
--- a/curator-test-zk34/pom.xml
+++ b/curator-test-zk34/pom.xml
@@ -168,6 +168,7 @@
                         <dependency>org.apache.curator:curator-framework</dependency>
                         <dependency>org.apache.curator:curator-recipes</dependency>
                     </dependenciesToScan>
+                    <excludedGroups>zk35</excludedGroups>
                 </configuration>
             </plugin>
 
@@ -195,4 +196,4 @@
             </plugin>
         </plugins>
     </build>
-</project>
\ No newline at end of file
+</project>

http://git-wip-us.apache.org/repos/asf/curator/blob/4c993572/curator-test/src/main/java/org/apache/curator/test/BaseClassForTests.java
----------------------------------------------------------------------
diff --git a/curator-test/src/main/java/org/apache/curator/test/BaseClassForTests.java b/curator-test/src/main/java/org/apache/curator/test/BaseClassForTests.java
index 7c4af65..9ae6a5d 100644
--- a/curator-test/src/main/java/org/apache/curator/test/BaseClassForTests.java
+++ b/curator-test/src/main/java/org/apache/curator/test/BaseClassForTests.java
@@ -160,6 +160,7 @@ public class BaseClassForTests
                 return false;
             }
 
+            result.setStatus(ITestResult.SKIP);
             if ( result.getThrowable() != null )
             {
                 log.error("Retrying 1 time", result.getThrowable());


[6/6] curator git commit: Merge branch 'master' into CURATOR-490

Posted by ra...@apache.org.
Merge branch 'master' into CURATOR-490


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

Branch: refs/heads/master
Commit: a17d3af9ad618571f40844cf78beb7398e4a0241
Parents: caf2a9d 964f11a
Author: randgalt <ra...@apache.org>
Authored: Sun Dec 9 17:49:20 2018 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sun Dec 9 17:49:20 2018 -0500

----------------------------------------------------------------------

----------------------------------------------------------------------



[4/6] curator git commit: CURATOR-490 testReentrantSingleLock() should not be run for TestInterProcessSemaphoreMutex as InterProcessSemaphoreMutex is not re-entrant

Posted by ra...@apache.org.
CURATOR-490 testReentrantSingleLock() should not be run for TestInterProcessSemaphoreMutex as InterProcessSemaphoreMutex is not re-entrant


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

Branch: refs/heads/master
Commit: b94844af500054dc6aa1b342e2ea3665de5f232f
Parents: 1731834
Author: randgalt <ra...@apache.org>
Authored: Sun Dec 9 12:28:32 2018 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sun Dec 9 12:28:32 2018 -0500

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


http://git-wip-us.apache.org/repos/asf/curator/blob/b94844af/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphoreMutex.java
----------------------------------------------------------------------
diff --git a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphoreMutex.java b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphoreMutex.java
index cd8b83e..90bd7da 100644
--- a/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphoreMutex.java
+++ b/curator-recipes/src/test/java/org/apache/curator/framework/recipes/locks/TestInterProcessSemaphoreMutex.java
@@ -27,13 +27,19 @@ public class TestInterProcessSemaphoreMutex extends TestInterProcessMutexBase
 
     @Override
     @Test(enabled = false)
-    public void testReentrant() throws Exception
+    public void testReentrant()
     {
     }
 
     @Override
     @Test(enabled = false)
-    public void testReentrant2Threads() throws Exception
+    public void testReentrant2Threads()
+    {
+    }
+
+    @Override
+    @Test(enabled = false)
+    public void testReentrantSingleLock()
     {
     }
 


[3/6] curator git commit: Merge branch 'CURATOR-405' into CURATOR-490

Posted by ra...@apache.org.
Merge branch 'CURATOR-405' into CURATOR-490


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

Branch: refs/heads/master
Commit: 173183420688875c6e627260ffb4efbbdc48227c
Parents: 4c99357 d965266
Author: randgalt <ra...@apache.org>
Authored: Sun Dec 9 11:13:29 2018 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sun Dec 9 11:13:29 2018 -0500

----------------------------------------------------------------------
 .../org/apache/curator/framework/state/ConnectionStateManager.java  | 1 +
 1 file changed, 1 insertion(+)
----------------------------------------------------------------------



[5/6] curator git commit: Merge branch 'CURATOR-493' into CURATOR-490

Posted by ra...@apache.org.
Merge branch 'CURATOR-493' into CURATOR-490


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

Branch: refs/heads/master
Commit: caf2a9d81a333154a0d36fcea1a624d4e00df3e1
Parents: b94844a 05f6a56
Author: randgalt <ra...@apache.org>
Authored: Sun Dec 9 12:34:30 2018 -0500
Committer: randgalt <ra...@apache.org>
Committed: Sun Dec 9 12:34:30 2018 -0500

----------------------------------------------------------------------
 .../framework/imps/TestFrameworkEdges.java      | 70 +++++++++++++++-----
 1 file changed, 54 insertions(+), 16 deletions(-)
----------------------------------------------------------------------