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

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


The following commit(s) were added to refs/heads/master by this push:
     new a29c0a600 [test] Replace Awaitility with CommonTestUtils to reduce 
dependency (#3183)
a29c0a600 is described below

commit a29c0a600defa91d867f6b09aed7ca6a016507a2
Author: yuzelin <[email protected]>
AuthorDate: Tue Apr 9 17:21:56 2024 +0800

    [test] Replace Awaitility with CommonTestUtils to reduce dependency (#3183)
---
 .../apache/paimon/flink/PartialUpdateITCase.java   | 32 ++++++++++------------
 pom.xml                                            |  8 ------
 2 files changed, 14 insertions(+), 26 deletions(-)

diff --git 
a/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/PartialUpdateITCase.java
 
b/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/PartialUpdateITCase.java
index 5dd6a7322..a156bfb2d 100644
--- 
a/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/PartialUpdateITCase.java
+++ 
b/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/PartialUpdateITCase.java
@@ -27,6 +27,7 @@ import org.apache.paimon.schema.SchemaUtils;
 import org.apache.paimon.types.DataField;
 import org.apache.paimon.types.DataTypes;
 import org.apache.paimon.utils.BlockingIterator;
+import org.apache.paimon.utils.CommonTestUtils;
 
 import org.apache.flink.configuration.RestartStrategyOptions;
 import org.apache.flink.table.api.config.ExecutionConfigOptions;
@@ -35,18 +36,17 @@ import org.apache.flink.types.Row;
 import org.apache.flink.types.RowKind;
 import org.apache.flink.util.CloseableIterator;
 import org.assertj.core.api.Assertions;
-import org.awaitility.Awaitility;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.params.ParameterizedTest;
 import org.junit.jupiter.params.provider.ValueSource;
 
+import java.time.Duration;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
-import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 import java.util.stream.Collectors;
 
@@ -126,25 +126,21 @@ public class PartialUpdateITCase extends 
CatalogITCaseBase {
 
         batchSql("INSERT INTO ods_orders VALUES (1, 2, 3)");
         batchSql("INSERT INTO dim_persons VALUES (3, 'snow', 'jon', 23)");
-        Awaitility.await()
-                .pollInSameThread()
-                .atMost(5, TimeUnit.SECONDS)
-                .untilAsserted(
-                        () ->
-                                assertThat(rowsToList(batchSql("SELECT * FROM 
dwd_orders")))
-                                        .containsExactly(
-                                                Arrays.asList(1, 2, 3, "snow", 
"jon", 23)));
+        CommonTestUtils.waitUtil(
+                () ->
+                        rowsToList(batchSql("SELECT * FROM dwd_orders"))
+                                .contains(Arrays.asList(1, 2, 3, "snow", 
"jon", 23)),
+                Duration.ofSeconds(5),
+                Duration.ofMillis(200));
 
         batchSql("INSERT INTO ods_orders VALUES (1, 4, 3)");
         batchSql("INSERT INTO dim_persons VALUES (3, 'snow', 'targaryen', 
23)");
-        Awaitility.await()
-                .pollInSameThread()
-                .atMost(5, TimeUnit.SECONDS)
-                .untilAsserted(
-                        () ->
-                                assertThat(rowsToList(batchSql("SELECT * FROM 
dwd_orders")))
-                                        .containsExactly(
-                                                Arrays.asList(1, 4, 3, "snow", 
"targaryen", 23)));
+        CommonTestUtils.waitUtil(
+                () ->
+                        rowsToList(batchSql("SELECT * FROM dwd_orders"))
+                                .contains(Arrays.asList(1, 4, 3, "snow", 
"targaryen", 23)),
+                Duration.ofSeconds(5),
+                Duration.ofMillis(200));
 
         iter.close();
     }
diff --git a/pom.xml b/pom.xml
index fe09e3475..0aaa9977a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -96,7 +96,6 @@ under the License.
         <flink.forkCount>1C</flink.forkCount>
         <flink.reuseForks>true</flink.reuseForks>
         <testcontainers.version>1.19.1</testcontainers.version>
-        <awaitility.version>4.2.0</awaitility.version>
 
         <!-- Can be set to any value to reproduce a specific build. -->
         <test.randomization.seed/>
@@ -192,13 +191,6 @@ under the License.
             <artifactId>log4j-1.2-api</artifactId>
             <scope>test</scope>
         </dependency>
-
-        <dependency>
-            <groupId>org.awaitility</groupId>
-            <artifactId>awaitility</artifactId>
-            <version>${awaitility.version}</version>
-            <scope>test</scope>
-        </dependency>
     </dependencies>
 
     <dependencyManagement>

Reply via email to