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 2017/01/26 17:49:38 UTC

[30/40] curator git commit: testChildReaperCleansUpLockNodes() didn't work when container nodes are used

testChildReaperCleansUpLockNodes() didn't work when container nodes are used


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

Branch: refs/heads/persistent-watch
Commit: 304da977e32b7f311cefc9cba3d28e2ec236e38b
Parents: 5cf7d05
Author: randgalt <ra...@apache.org>
Authored: Fri Jan 13 09:04:31 2017 -0500
Committer: randgalt <ra...@apache.org>
Committed: Fri Jan 13 09:04:31 2017 -0500

----------------------------------------------------------------------
 .../recipes/locks/TestInterProcessSemaphore.java         | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/curator/blob/304da977/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 488b776..73c76e8 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
@@ -691,9 +691,16 @@ public class TestInterProcessSemaphore extends BaseClassForTests
 
             timing.forWaiting().sleepABit();
 
-            List<String> children = client.getChildren().forPath("/test");
+            try
+            {
+                List<String> children = client.getChildren().forPath("/test");
 
-            Assert.assertEquals(children.size(), 0, "All children of /test should have been reaped");
+                Assert.assertEquals(children.size(), 0, "All children of /test should have been reaped");
+            }
+            catch ( KeeperException.NoNodeException ok )
+            {
+                // this is OK - if Container Nodes are used the "/test" path will go away - no point in updating the test for deprecated code
+            }
         }
         finally
         {