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 <[email protected]>
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(
             () -> {

Reply via email to