You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@iotdb.apache.org by er...@apache.org on 2022/04/29 09:09:28 UTC

[iotdb] 01/01: [IOTDB-3046] Fix port binding error in ClientManagerTest

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

ericpai pushed a commit to branch bugfix/iotdb-3046
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit ee8ea6adda88db644e4ddcef43df419a5b265c2c
Author: ericpai <er...@hotmail.com>
AuthorDate: Fri Apr 29 17:09:13 2022 +0800

    [IOTDB-3046] Fix port binding error in ClientManagerTest
---
 .../src/test/java/org/apache/iotdb/commons/ClientManagerTest.java    | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/node-commons/src/test/java/org/apache/iotdb/commons/ClientManagerTest.java b/node-commons/src/test/java/org/apache/iotdb/commons/ClientManagerTest.java
index 54eeb70625..6fff749b71 100644
--- a/node-commons/src/test/java/org/apache/iotdb/commons/ClientManagerTest.java
+++ b/node-commons/src/test/java/org/apache/iotdb/commons/ClientManagerTest.java
@@ -37,6 +37,7 @@ import org.junit.Before;
 import org.junit.Test;
 
 import java.io.IOException;
+import java.net.InetSocketAddress;
 import java.net.ServerSocket;
 
 public class ClientManagerTest {
@@ -408,7 +409,9 @@ public class ClientManagerTest {
   }
 
   public void startServer() throws IOException {
-    metaServer = new ServerSocket(9003);
+    metaServer = new ServerSocket();
+    metaServer.setReuseAddress(true);
+    metaServer.bind(new InetSocketAddress(9003));
     metaServerListeningThread =
         new Thread(
             () -> {