diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/TestFsDatasetImpl.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/TestFsDatasetImpl.java index ac9c5086678..0985ae69704 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/TestFsDatasetImpl.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/datanode/fsdataset/impl/TestFsDatasetImpl.java @@ -586,7 +586,7 @@ public class TestFsDatasetImpl { Assert.fail("This is not a valid code path. " + "out.close should have thrown an exception."); } catch (IOException ioe) { - GenericTestUtils.assertExceptionContains(info.toString(), ioe); + GenericTestUtils.assertExceptionContains(info.getXferAddr(), ioe); } finalizedDir.setWritable(true); finalizedDir.setExecutable(true);