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 bce56bf270 [test] Fix unstable test: handle MiniCluster shutdown 
gracefully in collect method (#6913)
bce56bf270 is described below

commit bce56bf27025684bbc3bdde0985b54103bd2864e
Author: Shekhar Prasad Rajak <[email protected]>
AuthorDate: Sun Dec 28 22:03:13 2025 +0530

    [test] Fix unstable test: handle MiniCluster shutdown gracefully in collect 
method (#6913)
---
 .../paimon/flink/PrimaryKeyFileStoreTableITCase.java       | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git 
a/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/PrimaryKeyFileStoreTableITCase.java
 
b/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/PrimaryKeyFileStoreTableITCase.java
index 0d98587177..e1426fc8b5 100644
--- 
a/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/PrimaryKeyFileStoreTableITCase.java
+++ 
b/paimon-flink/paimon-flink-common/src/test/java/org/apache/paimon/flink/PrimaryKeyFileStoreTableITCase.java
@@ -142,11 +142,21 @@ public class PrimaryKeyFileStoreTableITCase extends 
AbstractTestBase {
                                         return;
                                     }
                                 } catch (Exception e) {
+                                    // If we can't get job status, assume the 
job has terminated.
+                                    // This handles cases where MiniCluster 
has already shut down.
+                                    // Similar to Flink's CollectResultFetcher 
behavior.
+                                    return;
+                                }
+                            }
+                            // Only cancel if job is not already terminated
+                            try {
+                                if 
(!client.getJobStatus().get().isGloballyTerminalState()) {
                                     client.cancel();
-                                    throw new RuntimeException(e);
                                 }
+                            } catch (Exception e) {
+                                // If we can't check status or cancel, assume 
job has terminated.
+                                // This handles IllegalStateException when 
MiniCluster is shut down.
                             }
-                            client.cancel();
                         });
         timeoutThread.start();
         return result.collect();

Reply via email to