jeel2420 commented on code in PR #14483: URL: https://github.com/apache/kafka/pull/14483#discussion_r1347129743
########## core/src/test/scala/unit/kafka/log/remote/RemoteIndexCacheTest.scala: ########## @@ -281,14 +282,8 @@ class RemoteIndexCacheTest { // no expired entries yet assertEquals(0, cache.expiredIndexes.size, "expiredIndex queue should be zero at start of test") - // invalidate the cache. it should async mark the entry for removal - cache.internalCache.invalidate(internalIndexKey) - - // wait until entry is marked for deletion - TestUtils.waitUntilTrue(() => cacheEntry.isMarkedForCleanup, - "Failed to mark cache entry for cleanup after invalidation") - TestUtils.waitUntilTrue(() => cacheEntry.isCleanStarted, - "Failed to cleanup cache entry after invalidation") + // call remove function to mark the entry for removal + cache.remove(internalIndexKey) // first it will be marked for cleanup, second time markForCleanup is called when cleanup() is called verify(cacheEntry, times(2)).markForCleanup() Review Comment: I removed `cleanup` call in `internalCache.asMap().computeIfPresent` and added wait as well but cleanup is not getting called. -- 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: jira-unsubscr...@kafka.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org