From 2ac01b273a1f8b114367bd8dfe5ad12ebad237b7 Mon Sep 17 00:00:00 2001 From: slfan1989 <55643692+slfan1989@users.noreply.github.com> Date: Wed, 8 Jun 2022 18:34:25 -0700 Subject: [PATCH] HDFS-16624. Fix flaky unit test TestDFSAdmin#testAllDatanodesReconfig (#4412) Reviewed-by: Viraj Jasani Signed-off-by: Tao Li --- .../java/org/apache/hadoop/hdfs/tools/TestDFSAdmin.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 0f0d7824edf..b4ae9bcaab2 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 @@ -1205,9 +1205,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));