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/12/27 09:49:27 UTC

[iotdb] branch bugfix/iotdb-5297 created (now 4f5f9879e4)

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

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


      at 4f5f9879e4 [IOTDB-5297] Add maxRetryTimes for IoTDBClusterNodeErrorStartUpIT to avoid infinite loop

This branch includes the following new commits:

     new 4f5f9879e4 [IOTDB-5297] Add maxRetryTimes for IoTDBClusterNodeErrorStartUpIT to avoid infinite loop

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[iotdb] 01/01: [IOTDB-5297] Add maxRetryTimes for IoTDBClusterNodeErrorStartUpIT to avoid infinite loop

Posted by er...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

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

commit 4f5f9879e4c2fde5441a8c73cf6185f17ce1fc1f
Author: ericpai <er...@hotmail.com>
AuthorDate: Tue Dec 27 17:49:08 2022 +0800

    [IOTDB-5297] Add maxRetryTimes for IoTDBClusterNodeErrorStartUpIT to avoid infinite loop
---
 .../it/cluster/IoTDBClusterNodeErrorStartUpIT.java         | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/integration-test/src/test/java/org/apache/iotdb/confignode/it/cluster/IoTDBClusterNodeErrorStartUpIT.java b/integration-test/src/test/java/org/apache/iotdb/confignode/it/cluster/IoTDBClusterNodeErrorStartUpIT.java
index 65b8bedad1..c0706eb2aa 100644
--- a/integration-test/src/test/java/org/apache/iotdb/confignode/it/cluster/IoTDBClusterNodeErrorStartUpIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/confignode/it/cluster/IoTDBClusterNodeErrorStartUpIT.java
@@ -70,6 +70,7 @@ public class IoTDBClusterNodeErrorStartUpIT {
 
   private static final String TEST_CLUSTER_NAME = "defaultCluster";
   private static final String ERROR_CLUSTER_NAME = "errorCluster";
+  private static final int maxRetryTimes = 60;
 
   @Before
   public void setUp() throws Exception {
@@ -240,7 +241,8 @@ public class IoTDBClusterNodeErrorStartUpIT {
       // Shutdown and check
       EnvFactory.getEnv().shutdownConfigNode(1);
       EnvFactory.getEnv().shutdownDataNode(0);
-      while (true) {
+      int retryTimes;
+      for (retryTimes = 0; retryTimes < maxRetryTimes; retryTimes++) {
         AtomicInteger unknownCnt = new AtomicInteger(0);
         showClusterResp = client.showCluster();
         showClusterResp
@@ -257,6 +259,10 @@ public class IoTDBClusterNodeErrorStartUpIT {
         }
         TimeUnit.SECONDS.sleep(1);
       }
+      if (retryTimes >= maxRetryTimes) {
+        Assert.fail(
+            "The running nodes are still insufficient after retrying " + maxRetryTimes + " times");
+      }
 
       /* Restart and updatePeer */
       // TODO: @Itami-sho, enable this test and delete it
@@ -286,7 +292,7 @@ public class IoTDBClusterNodeErrorStartUpIT {
       // Restart and check
       EnvFactory.getEnv().startConfigNode(1);
       EnvFactory.getEnv().startDataNode(0);
-      while (true) {
+      for (retryTimes = 0; retryTimes < maxRetryTimes; retryTimes++) {
         AtomicInteger runningCnt = new AtomicInteger(0);
         showClusterResp = client.showCluster();
         showClusterResp
@@ -303,6 +309,10 @@ public class IoTDBClusterNodeErrorStartUpIT {
         }
         TimeUnit.SECONDS.sleep(1);
       }
+      if (retryTimes >= maxRetryTimes) {
+        Assert.fail(
+            "The running nodes are still insufficient after retrying " + maxRetryTimes + " times");
+      }
     }
   }
 }