ayushtkn commented on a change in pull request #1832:
URL: https://github.com/apache/ozone/pull/1832#discussion_r563258733



##########
File path: 
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestRootedOzoneFileSystem.java
##########
@@ -1225,6 +1236,15 @@ public void testTrash() throws Exception {
       }
     }, 1000, 180000);
 
+    Assert.assertTrue(getOMMetrics()
+        .getNumTrashDeletes() >= prevNumTrashDeletes);
+    Assert.assertTrue(getOMMetrics()
+        .getNumTrashRenames() > prevNumTrashRenames);
+    Assert.assertTrue(getOMMetrics()
+        .getNumTrashFilesDeletes() >= prevNumTrashFileDeletes);

Review comment:
       If for `prevNumTrashDeletes` and `prevNumTrashFileDeletes ` the equality 
hold true, That would mean the metrics didn't increment, which won't serve the 
purpose of the test. Can we ditch the `=` in the assertion and confirm the 
metric value gets incremented. Something like -
   ```
       GenericTestUtils.waitFor(
           () -> getOMMetrics().getNumTrashDeletes() > prevNumTrashDeletes
               && getOMMetrics().getNumTrashFilesDeletes()
               > prevNumTrashFileDeletes, 100, 180000);
   ```
   Unless there is some catch here, in that case it should be ok..




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

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