You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@curator.apache.org by GitBox <gi...@apache.org> on 2020/03/17 01:15:11 UTC

[GitHub] [curator] Randgalt commented on a change in pull request #334: [CURATOR-549] Support ZooKeeper 3.6.0 Persistent Recursive Watchers

Randgalt commented on a change in pull request #334: [CURATOR-549] Support ZooKeeper 3.6.0 Persistent Recursive Watchers
URL: https://github.com/apache/curator/pull/334#discussion_r393393447
 
 

 ##########
 File path: curator-framework/src/test/java/org/apache/curator/framework/imps/TestWatchesBuilder.java
 ##########
 @@ -611,6 +614,56 @@ public void pathAddedForGuaranteedOperation(
         }
     }
 
+    @Test(groups = CuratorTestBase.zk36Group)
+    public void testPersistentRecursiveWatch() throws Exception
+    {
+        try ( CuratorFramework client = CuratorFrameworkFactory.newClient(server.getConnectString(), new RetryOneTime(1)) )
+        {
+            client.start();
+            client.blockUntilConnected();
+
+            CountDownLatch latch = new CountDownLatch(5);
+            Watcher watcher = event -> latch.countDown();
+            client.watchers().add().withMode(AddWatchMode.PERSISTENT_RECURSIVE).usingWatcher(watcher).forPath("/test");
+
+            client.create().forPath("/test");
 
 Review comment:
   I was thinking it isn't necessary to test functionality that's already tested in ZK itself. But, this is a good point. I'll add some more tests.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services