HDFS-17422. Enhance the stability of the unit test TestDFSAdmin (#6621). Contributed by lei w and Hualong Zhang.

Signed-off-by: He Xiaoqiao <hexiaoqiao@apache.org>
This commit is contained in:
Lei313 2024-03-12 12:25:33 +08:00 committed by GitHub
parent bb32aec88e
commit dbf08c872a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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);
}
}