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

[iotdb] branch master updated: [IOTDB-5054] Fix errors in IoTDBPipeIT (#8438)

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 86919fb9f9 [IOTDB-5054] Fix errors in IoTDBPipeIT (#8438)
86919fb9f9 is described below

commit 86919fb9f9cfcd0f7874c61ed8abdfb697726a22
Author: Chen YZ <43...@users.noreply.github.com>
AuthorDate: Sun Dec 18 12:09:26 2022 +0800

    [IOTDB-5054] Fix errors in IoTDBPipeIT (#8438)
---
 integration-test/import-control.xml                        |  1 +
 integration-test/pom.xml                                   |  5 +++++
 .../test/java/org/apache/iotdb/db/it/sync/IoTDBPipeIT.java | 14 ++++++++++++++
 3 files changed, 20 insertions(+)

diff --git a/integration-test/import-control.xml b/integration-test/import-control.xml
index 9e7bee380d..99aec0a099 100644
--- a/integration-test/import-control.xml
+++ b/integration-test/import-control.xml
@@ -22,6 +22,7 @@
   <disallow class="java.sql.DriverManager"/>
   <disallow class="javax.sql.DataSource"/>
   <allow class="java.security.SecureRandom" />
+  <allow class="org.awaitility.Awaitility"/>
   <allow pkg="org\.junit.*" regex="true"/>
   <allow pkg="java.io" />
   <allow pkg="java.nio"/>
diff --git a/integration-test/pom.xml b/integration-test/pom.xml
index 324f7e8ddd..88f827a060 100644
--- a/integration-test/pom.xml
+++ b/integration-test/pom.xml
@@ -82,6 +82,11 @@
             <artifactId>rewrite-tsfile-tool</artifactId>
             <version>${project.version}</version>
         </dependency>
+        <dependency>
+            <groupId>org.awaitility</groupId>
+            <artifactId>awaitility</artifactId>
+            <scope>test</scope>
+        </dependency>
     </dependencies>
     <dependencyManagement>
         <dependencies>
diff --git a/integration-test/src/test/java/org/apache/iotdb/db/it/sync/IoTDBPipeIT.java b/integration-test/src/test/java/org/apache/iotdb/db/it/sync/IoTDBPipeIT.java
index 64c02557e3..6accf72c71 100644
--- a/integration-test/src/test/java/org/apache/iotdb/db/it/sync/IoTDBPipeIT.java
+++ b/integration-test/src/test/java/org/apache/iotdb/db/it/sync/IoTDBPipeIT.java
@@ -26,6 +26,7 @@ import org.apache.iotdb.itbase.category.ClusterIT;
 import org.apache.iotdb.itbase.category.LocalStandaloneIT;
 
 import org.apache.commons.lang3.StringUtils;
+import org.awaitility.Awaitility;
 import org.junit.AfterClass;
 import org.junit.Assert;
 import org.junit.BeforeClass;
@@ -37,6 +38,7 @@ import java.sql.Connection;
 import java.sql.ResultSet;
 import java.sql.Statement;
 
+import static java.util.concurrent.TimeUnit.SECONDS;
 import static org.apache.iotdb.db.it.utils.TestUtils.assertResultSetEqual;
 
 @RunWith(IoTDBTestRunner.class)
@@ -110,6 +112,18 @@ public class IoTDBPipeIT {
         assertResultSetEqual(resultSet, SHOW_PIPE_HEADER, expectedRetSet);
       }
       statement.execute("START PIPE p1;");
+      Awaitility.await()
+          .atMost(5, SECONDS)
+          .until(
+              () -> {
+                try (ResultSet resultSet = statement.executeQuery("SHOW PIPE")) {
+                  int cnt = 0;
+                  while (resultSet.next()) {
+                    cnt++;
+                  }
+                  return cnt == 2;
+                }
+              });
       try (ResultSet resultSet = statement.executeQuery("SHOW PIPE")) {
         String[] expectedRetSet =
             new String[] {