Browse Source

HDFS-15632. AbstractContractDeleteTest should set recursive peremeter to true for recursive test cases. Contributed by Anton Kutuzov.

(cherry picked from commit 91d4ba57c5b85379303ac8fb2a1a03ba10b07d4e)
Anton Kutuzov 4 years ago
parent
commit
16e908e757

+ 3 - 4
hadoop-common-project/hadoop-common/src/test/java/org/apache/hadoop/fs/contract/AbstractContractDeleteTest.java

@@ -49,18 +49,17 @@ public abstract class AbstractContractDeleteTest extends
     Path path = path("testDeleteNonexistentPathRecursive");
     assertPathDoesNotExist("leftover", path);
     ContractTestUtils.rejectRootOperation(path);
-    assertFalse("Returned true attempting to delete"
+    assertFalse("Returned true attempting to recursively delete"
                 + " a nonexistent path " + path,
-                getFileSystem().delete(path, false));
+                getFileSystem().delete(path, true));
   }
 
-
   @Test
   public void testDeleteNonexistentPathNonRecursive() throws Throwable {
     Path path = path("testDeleteNonexistentPathNonRecursive");
     assertPathDoesNotExist("leftover", path);
     ContractTestUtils.rejectRootOperation(path);
-    assertFalse("Returned true attempting to recursively delete"
+    assertFalse("Returned true attempting to non recursively delete"
                 + " a nonexistent path " + path,
                 getFileSystem().delete(path, false));
   }