Copilot commented on code in PR #12064:
URL: https://github.com/apache/ozone/pull/12064#discussion_r4585819660


##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestKeyLifecycleService.java:
##########
@@ -1037,7 +1037,8 @@ void 
testFSOScanSkipsDirectoriesWhenCachedDirectoryMaxCountExceeded(long cachedD
 
       GenericTestUtils.LogCapturer logCapturer = 
GenericTestUtils.LogCapturer.captureLogs(
           LoggerFactory.getLogger(KeyLifecycleService.class));
-      runSingleLifecycleScanAndDeleteConfiguration(volumeName, bucketName);
+      // Keep the lifecycle policy until the scan finishes so scan state can 
be persisted
+      runSingleLifecycleScan(volumeName, bucketName, false);

Review Comment:
   Passing `false` leaves the policy active and releases the helper's 
injectors, allowing another scan before the first scan's assertions finish. 
With `cachedDirLimit = 3`, that scan can delete the keys in `dir1/dir5`, 
raising the deleted-key count from 2 to 4 and making the test fail 
intermittently. Keep the policy for state persistence, but gate the follow-up 
task until the assertions finish, then release it for cleanup, following the 
nearby `nextTaskStart` pattern.



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