aswinshakil commented on code in PR #4811:
URL: https://github.com/apache/ozone/pull/4811#discussion_r1228574813


##########
hadoop-ozone/integration-test/src/test/java/org/apache/hadoop/fs/ozone/TestSnapshotDeletingService.java:
##########
@@ -342,17 +384,55 @@ public void testSnapshotWithFSO() throws Exception {
     assertTableRowCount(snapshotInfoTable, 1);
     assertTableRowCount(renamedTable, 4);
     assertTableRowCount(deletedDirTable, 3);
-    assertTableRowCount(deletedTable, 10);
+
+    OmSnapshot snap1 = (OmSnapshot) om.getOmSnapshotManager()
+        .checkForSnapshot(VOLUME_NAME, BUCKET_NAME_TWO,
+            getSnapshotPrefix("snap1"), true);
+    Table<String, OmKeyInfo> snap1KeyTable =
+        snap1.getMetadataManager().getFileTable();
+    try (TableIterator<String, ? extends Table.KeyValue<String,
+        RepeatedOmKeyInfo>> iterator = deletedTable.iterator()) {
+      while (iterator.hasNext()) {
+        Table.KeyValue<String, RepeatedOmKeyInfo> next = iterator.next();
+        String activeDBDeletedKey = next.getKey();
+        if (activeDBDeletedKey.matches(".*/key1.*")) {
+          RepeatedOmKeyInfo activeDBDeleted = next.getValue();
+          OMMetadataManager metadataManager =
+              cluster.getOzoneManager().getMetadataManager();
+          GenericTestUtils.waitFor(() -> activeDBDeleted.getOmKeyInfoList()
+              .size() == 1, 100, 2000);

Review Comment:
   Nice catch, You are right. We can just have assert instead of this. Will 
update the PR. 



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