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 2019/12/18 20:27:57 UTC

[GitHub] [zookeeper] kishorvpatil opened a new pull request #1188: Remove localhost hardcoding from QuorumSSLTest

kishorvpatil opened a new pull request #1188: Remove localhost hardcoding from QuorumSSLTest
URL: https://github.com/apache/zookeeper/pull/1188
 
 
   Depending on localhost and /etc/hosts config, this test can fail.. So trying make it more resilient.

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

[GitHub] [zookeeper] kishorvpatil commented on a change in pull request #1188: [ZOOKEEPER-3655] Remove localhost hardcoding from QuorumSSLTest

Posted by GitBox <gi...@apache.org>.
kishorvpatil commented on a change in pull request #1188: [ZOOKEEPER-3655] Remove localhost hardcoding from QuorumSSLTest
URL: https://github.com/apache/zookeeper/pull/1188#discussion_r362641153
 
 

 ##########
 File path: zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumSSLTest.java
 ##########
 @@ -122,10 +124,26 @@
     private static final String PORT_UNIFICATION_DISABLED = "portUnification=false\n";
 
     private static final char[] PASSWORD = "testpass".toCharArray();
-    private static final String HOSTNAME = "localhost";
+
+    private static String HOSTNAME;
+    private static String ipAddress;
+
+    {
+        InetAddress address = null;
+        try {
+            address = InetAddress.getLocalHost();
+            HOSTNAME = address.getHostName();
+            ipAddress = address.getHostAddress();
+        } catch (UnknownHostException e) {
+            e.printStackTrace();
+        }
 
 Review comment:
   @maoling , The test fails if /etc/hosts has ipv6 because localhost or ip address is hardcoded in the tests. The change makes it agostic to host setup.

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

[GitHub] [zookeeper] kishorvpatil edited a comment on issue #1188: [ZOOKEEPER-3655] Remove localhost hardcoding from QuorumSSLTest

Posted by GitBox <gi...@apache.org>.
kishorvpatil edited a comment on issue #1188: [ZOOKEEPER-3655] Remove localhost hardcoding from QuorumSSLTest
URL: https://github.com/apache/zookeeper/pull/1188#issuecomment-591520927
 
 
   @anmolnar , The PR for master is available now #1272

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

[GitHub] [zookeeper] kishorvpatil commented on issue #1188: [ZOOKEEPER-3655] Remove localhost hardcoding from QuorumSSLTest

Posted by GitBox <gi...@apache.org>.
kishorvpatil commented on issue #1188: [ZOOKEEPER-3655] Remove localhost hardcoding from QuorumSSLTest
URL: https://github.com/apache/zookeeper/pull/1188#issuecomment-591520927
 
 
   @anmolnar , The PR for master is available now #1272 1272

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

[GitHub] [zookeeper] kishorvpatil commented on a change in pull request #1188: [ZOOKEEPER-3655] Remove localhost hardcoding from QuorumSSLTest

Posted by GitBox <gi...@apache.org>.
kishorvpatil commented on a change in pull request #1188: [ZOOKEEPER-3655] Remove localhost hardcoding from QuorumSSLTest
URL: https://github.com/apache/zookeeper/pull/1188#discussion_r362641153
 
 

 ##########
 File path: zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumSSLTest.java
 ##########
 @@ -122,10 +124,26 @@
     private static final String PORT_UNIFICATION_DISABLED = "portUnification=false\n";
 
     private static final char[] PASSWORD = "testpass".toCharArray();
-    private static final String HOSTNAME = "localhost";
+
+    private static String HOSTNAME;
+    private static String ipAddress;
+
+    {
+        InetAddress address = null;
+        try {
+            address = InetAddress.getLocalHost();
+            HOSTNAME = address.getHostName();
+            ipAddress = address.getHostAddress();
+        } catch (UnknownHostException e) {
+            e.printStackTrace();
+        }
 
 Review comment:
   @maoling , The test fails if /etc/hosts has ipv6 because localhost or ip address is hardcoded in the tests. The change makes it agnostic to host setup.

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

[GitHub] [zookeeper] maoling commented on a change in pull request #1188: [ZOOKEEPER-3655] Remove localhost hardcoding from QuorumSSLTest

Posted by GitBox <gi...@apache.org>.
maoling commented on a change in pull request #1188: [ZOOKEEPER-3655] Remove localhost hardcoding from QuorumSSLTest
URL: https://github.com/apache/zookeeper/pull/1188#discussion_r361127682
 
 

 ##########
 File path: zookeeper-server/src/test/java/org/apache/zookeeper/server/quorum/QuorumSSLTest.java
 ##########
 @@ -122,10 +124,26 @@
     private static final String PORT_UNIFICATION_DISABLED = "portUnification=false\n";
 
     private static final char[] PASSWORD = "testpass".toCharArray();
-    private static final String HOSTNAME = "localhost";
+
+    private static String HOSTNAME;
+    private static String ipAddress;
+
+    {
+        InetAddress address = null;
+        try {
+            address = InetAddress.getLocalHost();
+            HOSTNAME = address.getHostName();
+            ipAddress = address.getHostAddress();
+        } catch (UnknownHostException e) {
+            e.printStackTrace();
+        }
 
 Review comment:
   -  When `UnknownHostException` happens, `ipAddress` should still use the `127.0.0.1` as default ?
   - >  Depending on localhost and /etc/hosts config, this test can fail.. So trying make it more resilient.
   
     Could you plz explain more for me to understand the benefit of this change?

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