diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/AbstractContractCreateTest.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/AbstractContractCreateTest.java index 2053f50b6b..07c99e0b6a 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/AbstractContractCreateTest.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/AbstractContractCreateTest.java @@ -244,12 +244,12 @@ public void testCreatedFileIsVisibleOnFlush() throws Throwable { out.write('a'); out.flush(); if (!fs.exists(path)) { - - if (isSupported(IS_BLOBSTORE)) { - // object store: downgrade to a skip so that the failure is visible - // in test results - skip("Filesystem is an object store and newly created files are not " - + "immediately visible"); + if (isSupported(IS_BLOBSTORE) || + isSupported(CREATE_VISIBILITY_DELAYED)) { + // object store or some file systems: downgrade to a skip so that the + // failure is visible in test results + skip("For object store or some file systems, newly created files are" + + " not immediately visible"); } assertPathExists("expected path to be visible before file closed", path); diff --git a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/resources/contract/webhdfs.xml b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/resources/contract/webhdfs.xml index f9b7d9435d..0cb6dd8a6d 100644 --- a/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/resources/contract/webhdfs.xml +++ b/hadoop-hdfs-project/hadoop-hdfs-rbf/src/test/resources/contract/webhdfs.xml @@ -23,4 +23,9 @@ false + + fs.contract.create-visibility-delayed + true + +