You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@zookeeper.apache.org by GitBox <gi...@apache.org> on 2021/03/09 13:11:37 UTC

[GitHub] [zookeeper] MuktiKrishnan commented on a change in pull request #1621: ZOOKEEPER-1871: Add an option to zkCli to wait for connection before executing commands

MuktiKrishnan commented on a change in pull request #1621:
URL: https://github.com/apache/zookeeper/pull/1621#discussion_r590355426



##########
File path: zookeeper-server/src/test/java/org/apache/zookeeper/ZooKeeperTest.java
##########
@@ -685,4 +686,25 @@ public void testSyncCommand() throws Exception {
         runCommandExpect(cmd, expected);
     }
 
+    @Test
+    public void testWaitForConnection() throws Exception {
+        // get a wrong port number
+        int invalid_port = PortAssignment.unique();
+        long timeout = 3000L; // millisecond
+        String[] args1 = {"-server", "localhost:" + invalid_port, "-timeout",
+            Long.toString(timeout), "-waitforconnection", "ls", "/"};
+        long start_time = System.currentTimeMillis();
+        // try to connect to a non-existing server so as to wait until wait_timeout

Review comment:
       Used CamelCase naming style. Thanks @maoling for pointing out




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