szetszwo commented on code in PR #4337:
URL: https://github.com/apache/ozone/pull/4337#discussion_r1135215847


##########
hadoop-hdds/container-service/src/test/java/org/apache/hadoop/ozone/container/keyvalue/TestKeyValueContainerMetadataInspector.java:
##########
@@ -243,11 +342,24 @@ private void 
checkJsonReportForIncorrectContainer(JsonObject inspectJson,
 
     // Check errors.
     checkJsonErrorsReport(inspectJson, "dBMetadata.#BLOCKCOUNT",
-        new JsonPrimitive(createdBlocks), new JsonPrimitive(setBlocks),
-        shouldRepair);
+        createdBlocks, setBlocks, shouldRepair);
     checkJsonErrorsReport(inspectJson, "dBMetadata.#BYTESUSED",
-        new JsonPrimitive(createdBytes), new JsonPrimitive(setBytes),
-        shouldRepair);
+        createdBytes, setBytes, shouldRepair);
+    checkJsonErrorsReport(inspectJson, "dBMetadata.#PENDINGDELETEBLOCKCOUNT",
+        deleteCount, deleteTransactions, shouldRepair);
+  }
+
+  private void checkJsonErrorsReport(
+      JsonObject jsonReport, String propertyValue,
+      long correctExpected, long correctActual,
+      boolean correctRepair) {
+    if (correctExpected == correctActual) {
+      return;
+    }

Review Comment:
   The `errors` array may not cover all cases, e.g. 
`dBMetadata.#PENDINGDELETEBLOCKCOUNT` has error but neither 
`dBMetadata.#BLOCKCOUNT` nor `dBMetadata.#BYTESUSED`.
   
   > Also this is just comparing the two expected values. ...
   
   When they are equal, there is no error report for that property.



-- 
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]

Reply via email to