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


##########
core/src/test/java/org/apache/iceberg/TestManifestCaching.java:
##########
@@ -178,31 +181,20 @@ 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.
+    // Insert the last FileIO and trigger GC + cleanup.
     FileIO lastIO = cacheEnabledHadoopFileIO();
     ContentCache lastCache = contentCache(manifestCache, lastIO);
-    System.gc();
+    GcFinalization.awaitFullGc();

Review Comment:
   So this seems like a better approach, but it looks like the recommendation 
is to use `awaitClear`/`awaitDone` with some condition and timeout if possible. 
 `awaitFullGc` appears to only wait for a single reference (probably something 
they construct as part of the test).  Seems likely that we could still end up 
in a flaky test condition.



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