HDFS-13404. Addendum: RBF: TestRouterWebHDFSContractAppend.testRenameFileBeingAppended fail. Contributed by Takanobu Asanuma.

(cherry picked from commit b52fd05d42)

Conflicts:
	hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/AbstractContractAppendTest.java
This commit is contained in:
Kihwal Lee 2020-02-25 12:28:56 -06:00
parent e80b5ec58d
commit 3b86011c24
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(100);
}
outputStream.write(dataset);
Path renamed = new Path(testPath, "renamed");
rename(target, renamed);