youngyjd commented on code in PR #8862:
URL: https://github.com/apache/gravitino/pull/8862#discussion_r2446510648


##########
core/src/test/java/org/apache/gravitino/cache/TestCacheConfig.java:
##########
@@ -152,22 +152,40 @@ void testPolicyAndTagCacheWeigher() throws 
InterruptedException {
           List.of(fileset));
     }
 
-    Thread.sleep(1000);
+    // Force cache cleanup to trigger eviction synchronously
+    cache.cleanUp();
 
-    // There should no tag entities in the cache, because the weight of each 
tag entity is 100 that
-    // is higher than the maximum weight of the fileset entity which is 200.
-    Awaitility.await()
-        .atMost(Duration.ofSeconds(5))

Review Comment:
   - Doesn't actually fix the root cause - the test could still fail even after 
10 seconds. test might pass 99% of time but still be flaky
   - Still non-deterministic - specific tags (0-3) may never be evicted, 
regardless of how long we wait
   
   Is there any reason you think waiting 10 seconds is better than we evict 
cache to clean up?



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

Reply via email to