smengcl commented on code in PR #8587:
URL: https://github.com/apache/ozone/pull/8587#discussion_r2377990298
##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestKeyDeletingService.java:
##########
@@ -299,21 +300,34 @@ void checkDeletedTableCleanUpForSnapshot() throws
Exception {
// Create snapshot
String snapName = uniqueObjectName("snap");
writeClient.createSnapshot(volumeName, bucketName1, snapName);
-
+ keyDeletingService.suspend();
// Delete the key
writeClient.deleteKey(key1);
writeClient.deleteKey(key2);
-
+ // Create a key3 in bucket1 which should be reclaimable to check quota
usage.
+ OmKeyArgs key3 = createAndCommitKey(volumeName, bucketName1,
uniqueObjectName(keyName), 3);
+ OmBucketInfo bucketInfo = writeClient.getBucketInfo(volumeName,
bucketName1);
+ long key1Size = QuotaUtil.getReplicatedSize(key1.getDataSize(),
key1.getReplicationConfig());
+ long key3Size = QuotaUtil.getReplicatedSize(key3.getDataSize(),
key3.getReplicationConfig());
+
+ assertEquals(key1Size, bucketInfo.getSnapshotUsedBytes());
+ assertEquals(1, bucketInfo.getSnapshotUsedNamespace());
+ writeClient.deleteKey(key3);
+ bucketInfo = writeClient.getBucketInfo(volumeName, bucketName1);
+ assertEquals(key1Size + key3Size, bucketInfo.getSnapshotUsedBytes());
+ assertEquals(2, bucketInfo.getSnapshotUsedNamespace());
+ writeClient.getBucketInfo(volumeName, bucketName1);
+ keyDeletingService.resume();
// Run KeyDeletingService
GenericTestUtils.waitFor(
- () -> getDeletedKeyCount() >= initialDeletedCount + 1,
- 1000, 10000);
+ () -> getDeletedKeyCount() >= initialDeletedCount + 2,
+ 1000, 1000000);
Review Comment:
Is 1000s timeout a bit too excessive?
--
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]