HDFS-13404. RBF: TestRouterWebHDFSContractAppend.testRenameFileBeingAppended fails.

(cherry picked from commit 559cb11551)
This commit is contained in:
Takanobu Asanuma 2019-02-05 06:06:05 +09:00 committed by Akira Ajisaka
parent e17b7efd3b
commit 43f7ab2cf0
No known key found for this signature in database
GPG Key ID: C1EDBB9CA400FD50
1 changed files with 6 additions and 0 deletions

View File

@ -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);