smengcl commented on code in PR #4573:
URL: https://github.com/apache/ozone/pull/4573#discussion_r1182993371


##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/TestOmMetadataManager.java:
##########
@@ -236,10 +237,25 @@ public void testListBuckets() throws Exception {
       }
     }
 
-    // List all buckets which have prefix ozoneBucket
+    for (int i = 1; i < 100; i++) {
+      if (i % 2 == 0) { // This part adds 49 buckets.
+        OMRequestTestUtils.addSnapshotToTable(
+            volumeName1, prefixBucketNameWithOzoneOwner + i,
+            prefixSnapshot + i, omMetadataManager);
+      }
+    }
     List<OmBucketInfo> omBucketInfoList =
+        omMetadataManager.listBuckets(volumeName1, null, null, 100, true);
+    assertEquals(omBucketInfoList.size(), 49);
+    for (OmBucketInfo omBucketInfo : omBucketInfoList) {
+      assertTrue(omBucketInfo.getBucketName().startsWith(
+          prefixBucketNameWithOzoneOwner));
+    }

Review Comment:
   We could use the same loop structure as above (`if (i % 2 == 0)`) to check 
the result has exactly the expected buckets (`prefixBucketNameWithOzoneOwner + 
i`).



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