浏览代码

HADOOP-19558. Skip testRenameFileBeingAppended on Windows (#7666)

* The `AbstractContractAppendTest#testRenameFileBeingAppended()`
  tries to rename the file while the handle
  to the file is open.
* This isn't allowed on Windows, and thus the
  call to rename fails.
* Thus, we need to skip this test on Windows.
Gautham B A 1 周之前
父节点
当前提交
b0a71903ae

+ 11 - 0
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/rawlocal/TestRawlocalContractAppend.java

@@ -18,7 +18,10 @@
 
 
 package org.apache.hadoop.fs.contract.rawlocal;
 package org.apache.hadoop.fs.contract.rawlocal;
 
 
+import org.junit.Assume;
+
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.Path;
 import org.apache.hadoop.fs.contract.AbstractContractAppendTest;
 import org.apache.hadoop.fs.contract.AbstractContractAppendTest;
 import org.apache.hadoop.fs.contract.AbstractFSContract;
 import org.apache.hadoop.fs.contract.AbstractFSContract;
 
 
@@ -29,4 +32,12 @@ public class TestRawlocalContractAppend extends AbstractContractAppendTest {
     return new RawlocalFSContract(conf);
     return new RawlocalFSContract(conf);
   }
   }
 
 
+  @Override
+  public void testRenameFileBeingAppended() throws Throwable {
+    // Renaming a file while its handle is open is not supported on Windows.
+    // Thus, this test should be skipped on Windows.
+    Assume.assumeFalse(Path.WINDOWS);
+
+    super.testRenameFileBeingAppended();
+  }
 }
 }