diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestNameEditsConfigs.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestNameEditsConfigs.java index 7071c661f3..1dc13d1b9d 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestNameEditsConfigs.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/namenode/TestNameEditsConfigs.java @@ -447,8 +447,12 @@ public void testNameEditsConfigsFailure() throws IOException { replication, SEED); checkFile(fileSys, file1, replication); } finally { - fileSys.close(); - cluster.shutdown(); + if (fileSys != null) { + fileSys.close(); + } + if (cluster != null) { + cluster.shutdown(); + } } // 2