diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/MiniDFSCluster.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/MiniDFSCluster.java index 484958e3c3..c4e99b1833 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/MiniDFSCluster.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/MiniDFSCluster.java @@ -2159,10 +2159,11 @@ public void shutdown(boolean deleteDfsDir, boolean closeFileSystem) { LOG.info("Shutting down the Mini HDFS Cluster"); if (checkExitOnShutdown) { if (ExitUtil.terminateCalled()) { - LOG.error("Test resulted in an unexpected exit", - ExitUtil.getFirstExitException()); + Exception cause = ExitUtil.getFirstExitException(); + LOG.error("Test resulted in an unexpected exit", cause); ExitUtil.resetFirstExitException(); - throw new AssertionError("Test resulted in an unexpected exit"); + throw new AssertionError("Test resulted in an unexpected exit: " + + cause.toString(), cause); } } if (closeFileSystem) {