From 559cb11551d7045015aa60afe7e7998fe0b2ef13 Mon Sep 17 00:00:00 2001 From: Takanobu Asanuma Date: Tue, 5 Feb 2019 06:06:05 +0900 Subject: [PATCH] HDFS-13404. RBF: TestRouterWebHDFSContractAppend.testRenameFileBeingAppended fails. --- .../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 d61b635449..02a899613c 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(10); + } outputStream.write(dataset); Path renamed = new Path(testPath, "renamed"); rename(target, renamed);