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
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]