From 3b86011c24c441f2b46ef612ceaaede3298ebd31 Mon Sep 17 00:00:00 2001 From: Kihwal Lee Date: Tue, 25 Feb 2020 12:28:56 -0600 Subject: [PATCH] HDFS-13404. Addendum: RBF: TestRouterWebHDFSContractAppend.testRenameFileBeingAppended fail. Contributed by Takanobu Asanuma. (cherry picked from commit b52fd05d42d9a76f6936a5d86c23fcd66244fe3d) Conflicts: hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/AbstractContractAppendTest.java --- .../hadoop/fs/contract/AbstractContractAppendTest.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/AbstractContractAppendTest.java b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/AbstractContractAppendTest.java index d61b6354498..a9fb1177397 100644 --- a/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/AbstractContractAppendTest.java +++ b/hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/AbstractContractAppendTest.java @@ -133,6 +133,12 @@ public abstract class AbstractContractAppendTest extends AbstractFSContractTestB assertPathExists("original file does not exist", target); byte[] dataset = dataset(256, 'a', 'z'); FSDataOutputStream outputStream = getFileSystem().append(target); + if (isSupported(CREATE_VISIBILITY_DELAYED)) { + // Some filesystems like WebHDFS doesn't assure sequential consistency. + // In such a case, delay is needed. Given that we can not check the lease + // because here is closed in client side package, simply add a sleep. + Thread.sleep(100); + } outputStream.write(dataset); Path renamed = new Path(testPath, "renamed"); rename(target, renamed);