Browse Source

HDFS-17133: TestFsDatasetImpl missing null check when cleaning up (#6079). Contributed by ConfX.

Signed-off-by: Ayush Saxena <ayushsaxena@apache.org>
ConfX 1 year ago
parent
commit
8931393302

+ 2 - 2
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/TestFsDatasetImpl.java

@@ -1173,7 +1173,7 @@ public class TestFsDatasetImpl {
       LOG.info("Exception in testMoveBlockFailure ", ex);
       fail("Exception while testing testMoveBlockFailure ");
     } finally {
-      if (cluster.isClusterUp()) {
+      if (cluster != null && cluster.isClusterUp()) {
         cluster.shutdown();
       }
     }
@@ -1984,4 +1984,4 @@ public class TestFsDatasetImpl {
       cluster.shutdown();
     }
   }
-}
+}