Преглед изворни кода

HADOOP-17396. ABFS: testRenameFileOverExistingFile fails (#2491)

Contributed by Sneha  Vijayarajan.
Sneha Vijayarajan пре 4 година
родитељ
комит
009ce4f02a

+ 5 - 0
hadoop-tools/hadoop-azure/src/test/java/org/apache/hadoop/fs/azurebfs/contract/ITestAbfsFileSystemContractRename.java

@@ -38,6 +38,11 @@ public class ITestAbfsFileSystemContractRename extends AbstractContractRenameTes
   public void setup() throws Exception {
     binding.setup();
     super.setup();
+    // Base rename contract test class re-uses the test folder
+    // This leads to failures when the test is re-run as same ABFS test
+    // containers are re-used for test run and creation of source and
+    // destination test paths fail, as they are already present.
+    binding.getFileSystem().delete(binding.getTestPath(), true);
   }
 
   @Override

+ 5 - 0
hadoop-tools/hadoop-azure/src/test/resources/azure-test.xml

@@ -38,6 +38,11 @@
     <value>false</value>
   </property>
 
+  <property>
+    <name>fs.contract.rename-returns-false-if-dest-exists</name>
+    <value>true</value>
+  </property>
+
   <!--====================  ABFS CONFIGURATION ====================-->
   <!-- SEE relevant section in "site/markdown/testing_azure.md"-->