diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/TestDFSAdmin.java b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/TestDFSAdmin.java index 451a419aa1..392866e86e 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/TestDFSAdmin.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/tools/TestDFSAdmin.java @@ -1353,8 +1353,14 @@ public void testDecommissionDataNodesReconfig() decommissioningNode1.getIpcPort(); String node2Addr = decommissioningNode2.getIpAddr() + ":" + decommissioningNode2.getIpcPort(); - assertTrue(outsForFinishReconf.get(0).contains(node1Addr) - && outsForFinishReconf.get(0).contains(node2Addr)); + int finishedReconfCount = 0; + for (String outMessage : outsForFinishReconf) { + finishedReconfCount = outMessage.contains(node1Addr) ? + finishedReconfCount + 1 : finishedReconfCount + 0; + finishedReconfCount = outMessage.contains(node2Addr) ? + finishedReconfCount + 1 : finishedReconfCount + 0; + } + assertTrue(finishedReconfCount == 2); } }