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/incubator-paimon.git


The following commit(s) were added to refs/heads/master by this push:
     new c706b56b5 [test] add wait time for runnable in thread pool (#1929)
c706b56b5 is described below

commit c706b56b53e859b44d00619aeef00c47d91b75b0
Author: YeJunHao <[email protected]>
AuthorDate: Thu Sep 7 20:13:37 2023 +0800

    [test] add wait time for runnable in thread pool (#1929)
---
 .../sink/AppendOnlyTableCompactionWorkerOperatorTest.java      | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git 
a/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/sink/AppendOnlyTableCompactionWorkerOperatorTest.java
 
b/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/sink/AppendOnlyTableCompactionWorkerOperatorTest.java
index 78802519e..aafba3384 100644
--- 
a/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/sink/AppendOnlyTableCompactionWorkerOperatorTest.java
+++ 
b/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/sink/AppendOnlyTableCompactionWorkerOperatorTest.java
@@ -40,6 +40,7 @@ import org.junit.jupiter.api.Test;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.concurrent.Future;
+import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
 /** Tests for {@link AppendOnlyTableCompactionWorkerOperator}. */
@@ -149,10 +150,17 @@ public class AppendOnlyTableCompactionWorkerOperatorTest 
extends TableTestBase {
         // shut down worker operator
         workerOperator.shutdown();
 
+        // wait the last runnable in thread pool to stop
+        Thread.sleep(2_000);
+
         for (Future<CommitMessage> f : workerOperator.result()) {
             try {
                 if (!f.isDone()) {
-                    break;
+                    try {
+                        f.get(5, TimeUnit.SECONDS);
+                    } catch (Exception e) {
+                        break;
+                    }
                 }
                 CommitMessage commitMessage = f.get();
                 List<DataFileMeta> fileMetas =

Reply via email to