You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@flink.apache.org by ro...@apache.org on 2022/03/16 14:18:47 UTC

[flink] branch release-1.15 updated: [FLINK-26573][test] Do not resolve the metadata file which is in progress

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

roman pushed a commit to branch release-1.15
in repository https://gitbox.apache.org/repos/asf/flink.git


The following commit(s) were added to refs/heads/release-1.15 by this push:
     new cc7a6407 [FLINK-26573][test] Do not resolve the metadata file which is in progress
cc7a6407 is described below

commit cc7a6407cd006ea20843ae6771125e4d54e0e72f
Author: Hangxiang Yu <ma...@gmail.com>
AuthorDate: Mon Mar 14 20:49:00 2022 +0800

    [FLINK-26573][test] Do not resolve the metadata file which is in progress
---
 .../src/test/java/org/apache/flink/test/util/TestUtils.java | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/flink-tests/src/test/java/org/apache/flink/test/util/TestUtils.java b/flink-tests/src/test/java/org/apache/flink/test/util/TestUtils.java
index 66ce4a4..8cbf3e3 100644
--- a/flink-tests/src/test/java/org/apache/flink/test/util/TestUtils.java
+++ b/flink-tests/src/test/java/org/apache/flink/test/util/TestUtils.java
@@ -35,7 +35,9 @@ import org.apache.flink.util.ExceptionUtils;
 import java.io.DataInputStream;
 import java.io.File;
 import java.io.IOException;
+import java.io.UncheckedIOException;
 import java.nio.file.Files;
+import java.nio.file.NoSuchFileException;
 import java.nio.file.Path;
 import java.nio.file.attribute.BasicFileAttributes;
 import java.util.Comparator;
@@ -138,8 +140,15 @@ public class TestUtils {
                                     path.getFileName().toString().equals(METADATA_FILE_NAME))
                     .findAny()
                     .isPresent();
-        } catch (IOException e) {
-            ExceptionUtils.rethrow(e);
+        } catch (UncheckedIOException uncheckedIOException) {
+            // return false when the metadata file is in progress due to subsumed checkpoint
+            if (ExceptionUtils.findThrowable(uncheckedIOException, NoSuchFileException.class)
+                    .isPresent()) {
+                return false;
+            }
+            throw uncheckedIOException;
+        } catch (IOException ioException) {
+            ExceptionUtils.rethrow(ioException);
             return false; // should never happen
         }
     }