From 6d008c0d39185f18dbec4676f4d0e7ef77104eb7 Mon Sep 17 00:00:00 2001 From: Ayush Saxena Date: Sat, 25 Jan 2020 11:47:29 +0530 Subject: [PATCH] HDFS-15128. Unit test failing to clean testing data and crashed future Maven test run due to failure in TestDataNodeVolumeFailureToleration. Contributed by Ctest --- .../datanode/TestDataNodeVolumeFailureToleration.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeVolumeFailureToleration.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeVolumeFailureToleration.java index a9e4096df4b..6165f05ee54 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/TestDataNodeVolumeFailureToleration.java +++ b/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 " + "dfs.datanode.failed.volumes.tolerated", e); } finally { + for (File dir : dirs) { + FileUtil.chmod(dir.toString(), "755"); + } boolean bpServiceState; // If the datanode not registered successfully, // because the invalid value configured for tolerated volumes @@ -257,10 +260,6 @@ public class TestDataNodeVolumeFailureToleration { .isBPServiceAlive(cluster.getNamesystem().getBlockPoolId()); } assertEquals(expectedBPServiceState, bpServiceState); - - for (File dir : dirs) { - FileUtil.chmod(dir.toString(), "755"); - } } }