[ 
https://issues.apache.org/jira/browse/HDFS-17448?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17832234#comment-17832234
 ] 

ASF GitHub Bot commented on HDFS-17448:
---------------------------------------

ayushtkn commented on code in PR #6690:
URL: https://github.com/apache/hadoop/pull/6690#discussion_r1544623497


##########
hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/server/diskbalancer/command/TestDiskBalancerCommand.java:
##########
@@ -834,8 +834,10 @@ public void 
testDiskBalancerQueryWithoutSubmitAndMultipleNodes() throws Exceptio
           .getIpcPort(), dataNode2.getIpcPort());
       final String cmdLine = String.format("hdfs diskbalancer %s", queryArg);
       List<String> outputs = runCommand(cmdLine);
-      assertThat(outputs.get(1), containsString("localhost:" + 
dataNode1.getIpcPort()));
-      assertThat(outputs.get(6), containsString("localhost:" + 
dataNode2.getIpcPort()));
+      assertTrue(outputs.get(1).contains("localhost:" + dataNode1.getIpcPort())
+          || outputs.get(6).contains("localhost:" + dataNode1.getIpcPort()));
+      assertTrue(outputs.get(1).contains("localhost:" + dataNode2.getIpcPort())
+          || outputs.get(6).contains("localhost:" + dataNode2.getIpcPort()));

Review Comment:
   I think we should print the entire outputs in the assertTrue if it fails for 
future, so we know what was in the outputs if any of these assertions fail.
   assertTrue can take one more argument for error message, we can put it there





>  Enhance the stability of the unit test TestDiskBalancerCommand 
> ----------------------------------------------------------------
>
>                 Key: HDFS-17448
>                 URL: https://issues.apache.org/jira/browse/HDFS-17448
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Haiyang Hu
>            Assignee: Haiyang Hu
>            Priority: Major
>              Labels: pull-request-available
>
> TestDiskBalancerCommand#testDiskBalancerQueryWithoutSubmitAndMultipleNodes  
> frequently fails tests, such as:
> https://ci-hadoop.apache.org/view/Hadoop/job/hadoop-qbt-trunk-java8-linux-x86_64/1540/testReport/junit/org.apache.hadoop.hdfs.server.diskbalancer.command/TestDiskBalancerCommand/testDiskBalancerQueryWithoutSubmitAndMultipleNodes/
> https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6637/1/testReport/org.apache.hadoop.hdfs.server.diskbalancer.command/TestDiskBalancerCommand/testDiskBalancerQueryWithoutSubmitAndMultipleNodes/
> I will fix it  enhance the stability of the unit test.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to