浏览代码

HDFS-15128. Unit test failing to clean testing data and crashed future Maven test run due to failure in TestDataNodeVolumeFailureToleration. Contributed by Ctest

Ayush Saxena 5 年之前
父节点
当前提交
6d008c0d39

+ 3 - 4
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeVolumeFailureToleration.java

@@ -246,6 +246,9 @@ public class TestDataNodeVolumeFailureToleration {
       GenericTestUtils.assertExceptionContains("Invalid value configured for "
       GenericTestUtils.assertExceptionContains("Invalid value configured for "
           + "dfs.datanode.failed.volumes.tolerated", e);
           + "dfs.datanode.failed.volumes.tolerated", e);
     } finally {
     } finally {
+      for (File dir : dirs) {
+        FileUtil.chmod(dir.toString(), "755");
+      }
       boolean bpServiceState;
       boolean bpServiceState;
       // If the datanode not registered successfully,
       // If the datanode not registered successfully,
       // because the invalid value configured for tolerated volumes
       // because the invalid value configured for tolerated volumes
@@ -257,10 +260,6 @@ public class TestDataNodeVolumeFailureToleration {
                     .isBPServiceAlive(cluster.getNamesystem().getBlockPoolId());
                     .isBPServiceAlive(cluster.getNamesystem().getBlockPoolId());
       }
       }
       assertEquals(expectedBPServiceState, bpServiceState);
       assertEquals(expectedBPServiceState, bpServiceState);
-
-      for (File dir : dirs) {
-        FileUtil.chmod(dir.toString(), "755");
-      }
     }
     }
   }
   }