This is an automated email from the ASF dual-hosted git repository.

ckj pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/ozone.git


The following commit(s) were added to refs/heads/master by this push:
     new ce697ca026 HDDS-9963. Intermittent failure in 
TestInterSCMGrpcProtocolService due to port conflict (#5831)
ce697ca026 is described below

commit ce697ca02602ccd0791ed11509dcef6955c2340e
Author: Doroszlai, Attila <[email protected]>
AuthorDate: Wed Dec 27 06:26:37 2023 +0100

    HDDS-9963. Intermittent failure in TestInterSCMGrpcProtocolService due to 
port conflict (#5831)
---
 .../apache/hadoop/hdds/scm/ha/TestInterSCMGrpcProtocolService.java    | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git 
a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/ha/TestInterSCMGrpcProtocolService.java
 
b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/ha/TestInterSCMGrpcProtocolService.java
index 95b6abc04a..b24f4506d3 100644
--- 
a/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/ha/TestInterSCMGrpcProtocolService.java
+++ 
b/hadoop-hdds/server-scm/src/test/java/org/apache/hadoop/hdds/scm/ha/TestInterSCMGrpcProtocolService.java
@@ -31,6 +31,7 @@ import org.apache.hadoop.hdds.utils.db.DBCheckpoint;
 import org.apache.hadoop.hdds.utils.db.DBStore;
 import org.apache.hadoop.hdds.utils.db.Table;
 import org.apache.hadoop.ozone.OzoneConfigKeys;
+import org.apache.ozone.test.GenericTestUtils.PortAllocator;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.io.TempDir;
 import org.mockito.ArgumentCaptor;
@@ -49,7 +50,6 @@ import java.nio.file.Paths;
 import java.security.KeyPair;
 import java.security.cert.CertificateException;
 import java.security.cert.X509Certificate;
-import java.util.Random;
 import java.util.concurrent.CompletableFuture;
 
 import static java.nio.charset.StandardCharsets.UTF_8;
@@ -90,7 +90,7 @@ class TestInterSCMGrpcProtocolService {
 
   @Test
   void testMTLSOnInterScmGrpcProtocolServiceAccess() throws Exception {
-    int port = new Random().nextInt(1000) + 45000;
+    int port = PortAllocator.getFreePort();
     OzoneConfiguration conf = setupConfiguration(port);
     SCMCertificateClient
         scmCertClient = setupCertificateClientForMTLS(conf);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to