rizaon commented on code in PR #5862:
URL: https://github.com/apache/iceberg/pull/5862#discussion_r981169482


##########
core/src/test/java/org/apache/iceberg/TestManifestCaching.java:
##########
@@ -178,27 +182,27 @@ public void testWeakFileIOReferenceCleanUp() {
 
     System.gc();
     manifestCache.cleanUp();
-    awaitQuiescence();
-    Assert.assertEquals(maxIO, manifestCache.estimatedSize());
     Assert.assertEquals(maxIO, manifestCache.stats().loadCount());
-    Assert.assertEquals(
-        "No entries should be evicted before 
IO_MANIFEST_CACHE_MAX_FILEIO_DEFAULT exceeded.",
-        0,
-        manifestCache.stats().evictionCount());
 
     // Insert one more FileIO to trigger cache eviction.
     FileIO lastIO = cacheEnabledHadoopFileIO();
     ContentCache lastCache = contentCache(manifestCache, lastIO);
-    System.gc();
-    manifestCache.cleanUp();
-    awaitQuiescence();
+
+    int numGC = 0;
+    int maxGC = 100;
+    while (manifestCache.estimatedSize() > 2 && numGC < maxGC) {
+      System.gc();

Review Comment:
   Replaced it with `GcFinalization.awaitFullGc` in rebased commit, 
[a0204a3](https://github.com/apache/iceberg/pull/5862/commits/a0204a38955188c70e2dcc7f9b3ff2a7e74fc949).
   
   I understand `iceberg-bundled-guava` relocate guava namespace from 
`com.google.common` to `org.apache.iceberg.relocated.com.google.common`. I 
don't know if and how to treat `guava-testlib` the same way.



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