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

tanxinyu pushed a commit to branch fix_client_manager_test
in repository https://gitbox.apache.org/repos/asf/iotdb.git

commit b66d34d5a7bfb7ce9d46eb61a57401df7d3fd1f0
Author: LebronAl <[email protected]>
AuthorDate: Tue Apr 26 12:12:43 2022 +0800

    use logical clock
---
 .../test/java/org/apache/iotdb/commons/ClientManagerTest.java    | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

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 497eb910ec..131dee451c 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
@@ -236,7 +236,10 @@ public class ClientManagerTest {
     Assert.assertEquals(0, syncClusterManager.getPool().getNumIdle(endPoint));
 
     // get another sync client, should throw error and return null
+    long start = System.nanoTime();
     SyncDataNodeInternalServiceClient syncClient2 = 
syncClusterManager.borrowClient(endPoint);
+    long end = System.nanoTime();
+    Assert.assertTrue(end - start >= DefaultProperty.WAIT_CLIENT_TIMEOUT_MS * 
1000);
     Assert.assertNull(syncClient2);
 
     // return one sync client
@@ -300,10 +303,10 @@ public class ClientManagerTest {
     Assert.assertEquals(0, syncClusterManager.getPool().getNumIdle(endPoint));
 
     // get another sync client, should wait waitClientTimeoutMS ms, throw 
error and return null
-    long start = System.currentTimeMillis();
+    long start = System.nanoTime();
     SyncDataNodeInternalServiceClient syncClient2 = 
syncClusterManager.borrowClient(endPoint);
-    long end = System.currentTimeMillis();
-    Assert.assertTrue(end - start >= waitClientTimeoutMS);
+    long end = System.nanoTime();
+    Assert.assertTrue(end - start >= waitClientTimeoutMS * 1000);
     Assert.assertNull(syncClient2);
 
     // return one sync client

Reply via email to