arunsarin85 commented on code in PR #10025:
URL: https://github.com/apache/ozone/pull/10025#discussion_r3033282937


##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestKeyDeletingService.java:
##########
@@ -1166,18 +1166,19 @@ void cleanup() {
     }
 
     private void customizeConfig() {
-      // Define a small Ratis limit to force multiple batches for testing
-      // The actual byte size of protobuf messages depends on content.
-      // A small value like 1KB or 2KB should ensure batching for ~10-20 keys.
-      final int testRatisLimitBytes = 1024; // 2 KB to encourage multiple 
batches, 90% of the actualRatisLimitBytes.
-      // Set the specific Ratis limit for this test
+      // Define a small Ratis limit to force multiple batches for testing.
+      // With 50 keys and 1024 bytes limit (90% = ~921 bytes effective), this
+      // produces ~7 batches, confirming the batching logic works correctly.
+      final int testRatisLimitBytes = 1024;
       
conf.setStorageSize(OMConfigKeys.OZONE_OM_RATIS_LOG_APPENDER_QUEUE_BYTE_LIMIT,
           testRatisLimitBytes, StorageUnit.BYTES);
+      // Use a very large service interval so the background thread never fires
+      // during the test, preventing concurrent processing with 
runPeriodicalTaskNow().
+      conf.setTimeDuration(OZONE_BLOCK_DELETING_SERVICE_INTERVAL, 1, 
TimeUnit.DAYS);

Review Comment:
   Setting the interval to 1 day is effectively "suspending the background 
worker for the test duration" without needing code changes.
   
   Reason:
   The service is already suspended at the start of the test, but 
runPeriodicalTaskNow() requires a resume() first - shouldRun() is checked 
inside KeyDeletingTask.call(), so a suspended service silently does nothing.
   
   Problem:
   That when resume() is called, the 100ms scheduler is back up and running. 
Since runPeriodicalTaskNow() takes about 15 seconds, the background thread 
fires about 150 times at the same time, which could make the captured request 
count higher.



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