zookeeper-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] [zookeeper] swallez commented on a change in pull request #1091: ZOOKEEPER-3546: Delete empty containers with cversion == 0 after a grace period
Date Tue, 17 Sep 2019 12:26:44 GMT
swallez commented on a change in pull request #1091: ZOOKEEPER-3546: Delete empty containers
with cversion == 0 after a grace period
URL: https://github.com/apache/zookeeper/pull/1091#discussion_r325136948
 
 

 ##########
 File path: zookeeper-server/src/test/java/org/apache/zookeeper/server/CreateContainerTest.java
 ##########
 @@ -237,6 +237,22 @@ public Void call() throws Exception {
         assertEquals(queue.poll(5, TimeUnit.SECONDS), "/four");
     }
 
+    @Test(timeout = 30000)
+    public void testContainerWithNoChildGracePeriod() throws KeeperException, InterruptedException
{
+        zk.create("/foo", new byte[0], ZooDefs.Ids.OPEN_ACL_UNSAFE, CreateMode.CONTAINER);
+
+        ContainerManager containerManager = new ContainerManager(serverFactory.getZooKeeperServer().getZKDatabase(),
serverFactory.getZooKeeperServer().firstProcessor, 1, 100);
+        containerManager.checkContainers();
+        Thread.sleep(1000);
+
+        assertNotNull("Container should still be there", zk.exists("/foo", false));
+
+        containerManager.checkContainers();
 
 Review comment:
   I used the same approach as other tests in that class, where I understand that these `sleep`
after each call to `checkContainers` are precisely there to avoid flakiness by giving time
to the ZK server to asynchronously delete the nodes that have been selected for removal.
   
   Did I miss something?

----------------------------------------------------------------
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

Mime
View raw message