You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-issues@hadoop.apache.org by GitBox <gi...@apache.org> on 2019/08/16 00:39:15 UTC

[GitHub] [hadoop] bharatviswa504 commented on a change in pull request #1303: HDDS-1903 : Use dynamic ports for SCM in TestSCMClientProtocolServer …

bharatviswa504 commented on a change in pull request #1303: HDDS-1903 : Use dynamic ports for SCM in TestSCMClientProtocolServer …
URL: https://github.com/apache/hadoop/pull/1303#discussion_r314549215
 
 

 ##########
 File path: hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/server/TestSCMSecurityProtocolServer.java
 ##########
 @@ -32,10 +39,19 @@
 
   @Rule
   public Timeout timeout = new Timeout(1000 * 20);
+  private static int scmRpcSecurePort;
+
+  @BeforeClass
+  public static void setupClass() throws Exception {
+    scmRpcSecurePort = new ServerSocket(0).getLocalPort();
+  }
 
   @Before
   public void setUp() throws Exception {
     config = new OzoneConfiguration();
+    config.set(OZONE_SCM_SECURITY_SERVICE_ADDRESS_KEY,
+        StringUtils.join(OZONE_SCM_SECURITY_SERVICE_BIND_HOST_DEFAULT,
+            ":", String.valueOf(scmRpcSecurePort)));
 
 Review comment:
   Here we can directly specify OZONE_SCM_SECURITY_SERVICE_BIND_HOST_DEFAULT:0
   is there any reason for doing this way?

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

---------------------------------------------------------------------
To unsubscribe, e-mail: common-issues-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-issues-help@hadoop.apache.org