chihsuan commented on code in PR #8770:
URL: https://github.com/apache/ozone/pull/8770#discussion_r3594858169
##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/hdds/scm/TestContainerOperations.java:
##########
@@ -195,12 +199,23 @@ public void testDatanodeUsageInfoContainerCount() throws
Exception {
List<? extends DatanodeDetails> dnList = nodeManager.getAllNodes();
for (DatanodeDetails dn : dnList) {
- List<HddsProtos.DatanodeUsageInfoProto> usageInfoList =
- storageClient.getDatanodeUsageInfo(
- dn.getIpAddress(), dn.getUuidString());
+ GenericTestUtils.waitFor(() -> {
+ try {
+ List<HddsProtos.DatanodeUsageInfoProto> usageInfoList =
+ storageClient.getDatanodeUsageInfo(dn.getIpAddress(),
dn.getUuidString());
- assertEquals(1, usageInfoList.size());
- assertEquals(nodeManager.getContainers(dn).size(),
usageInfoList.get(0).getContainerCount());
+ assertEquals(1, usageInfoList.size());
+
+ long expected = nodeManager.getContainers(dn).size();
+ long actual = usageInfoList.get(0).getContainerCount();
+ LOG.info("Container count expected: {}, actual: {}", expected,
actual);
+
+ return expected == actual;
+ } catch (Exception e) {
+ LOG.info("Failed to get container count", e);
Review Comment:
Minor thought: if this times out, would it be helpful to include the last
observed expected/actual counts in the failure message? It might save a little
log digging if this ever flakes again.
Iām not sure whether you see value in that extra diagnostic; I'm happy to
defer if the current logging is considered sufficient. š
--
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]