chihsuan commented on code in PR #11145:
URL: https://github.com/apache/ozone/pull/11145#discussion_r3881138193
##########
hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/service/TestKeyLifecycleService.java:
##########
@@ -1110,22 +1127,24 @@ void testLastScannedKeySeek(boolean keyBelongToDir)
throws Exception {
GenericTestUtils.LogCapturer logCapturer =
GenericTestUtils.LogCapturer.captureLogs(
LoggerFactory.getLogger(KeyLifecycleService.class));
- keyLifecycleService.resume();
+ runSingleLifecycleScan(volumeName, bucketName);
- // dir1 can be fully evaluated depending on whether lastScannedKey
belong to it (no seek) or not
- // dir2 should be skipped dir2 > dir1
- int expectedDeleted = 2;
+ // dir2 is skipped since dir2 > dir1. dir1 is fully evaluated only when
lastScannedKey does not
+ // belong to it, otherwise the scan seeks past its last key and nothing
is left to expire.
+ int expectedDeleted = keyBelongToDir ? 0 : 2;
Review Comment:
Now that the test runs a single scan, this case deletes nothing. The resumed
scan seeks past `dir1`'s last key, and `dir2` is skipped because it sorts after
`dir1`. The old expectation of 2 passed only because a second periodic scan
deleted the rest. The Skip `dir2` assertion below keeps this case from checking
something positive.
--
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]