TaiJuWu commented on code in PR #18004:
URL: https://github.com/apache/kafka/pull/18004#discussion_r1959674449


##########
core/src/test/scala/unit/kafka/log/remote/RemoteIndexCacheTest.scala:
##########
@@ -619,27 +638,32 @@ class RemoteIndexCacheTest {
 
     val entry0 = cache.getIndexEntry(metadataList.head)
     val entry1 = cache.getIndexEntry(metadataList(1))
-    cache.getIndexEntry(metadataList(2))
+    val entry2 = cache.getIndexEntry(metadataList(2))
+    val entries = List(entry0, entry1, entry2)
     assertCacheSize(2)
-    verifyEntryIsEvicted(metadataList.head, entry0)
+    val (evictedSegmentMetadata, evictedEntry) = 
verifyEntryIsEvicted(metadataList, entries, 1)
 
-    // Reduce cache capacity to only store 1 entry
+    // Reduce cache capacity to only store 1 entry and check two entries are 
marked as deleted.
     cache.resizeCacheSize(1 * estimateEntryBytesSize)
     assertCacheSize(1)
-    verifyEntryIsEvicted(metadataList(1), entry1)
+    // After resize, we need to check an entry is deleted from cache and exist 
segmentMetadata
+    val entryInCache = entries.filterNot(evictedEntry.contains(_))
+    val existSegmentMetadata = 
metadataList.filterNot(evictedSegmentMetadata.contains(_))

Review Comment:
   Thanks for review! All comments are address in 
https://github.com/apache/kafka/pull/18004/commits/0707b98d78492680bef99c2d056644af3ccceec2



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

Reply via email to