HDFS-16624. Fix flaky unit test TestDFSAdmin#testAllDatanodesReconfig (#4412)

Reviewed-by: Viraj Jasani <vjasani@apache.org>
Signed-off-by: Tao Li <tomscut@apache.org>
This commit is contained in:
slfan1989 2022-06-08 18:34:25 -07:00 committed by tom lee
parent 7ec988d264
commit a2f8a9e5d8
1 changed files with 4 additions and 3 deletions

View File

@ -1098,9 +1098,10 @@ public class TestDFSAdmin {
LOG.info("dfsadmin -status -livenodes output:");
outs.forEach(s -> LOG.info("{}", s));
assertTrue(outs.get(0).startsWith("Reconfiguring status for node"));
assertEquals("SUCCESS: Changed property dfs.datanode.peer.stats.enabled", outs.get(2));
assertEquals("\tFrom: \"false\"", outs.get(3));
assertEquals("\tTo: \"true\"", outs.get(4));
assertTrue("SUCCESS: Changed property dfs.datanode.peer.stats.enabled".equals(outs.get(2))
|| "SUCCESS: Changed property dfs.datanode.peer.stats.enabled".equals(outs.get(1)));
assertTrue("\tFrom: \"false\"".equals(outs.get(3)) || "\tFrom: \"false\"".equals(outs.get(2)));
assertTrue("\tTo: \"true\"".equals(outs.get(4)) || "\tTo: \"true\"".equals(outs.get(3)));
assertEquals("SUCCESS: Changed property dfs.datanode.peer.stats.enabled", outs.get(5));
assertEquals("\tFrom: \"false\"", outs.get(6));
assertEquals("\tTo: \"true\"", outs.get(7));