kbendick commented on a change in pull request #3801:
URL: https://github.com/apache/iceberg/pull/3801#discussion_r775091445



##########
File path: core/src/test/java/org/apache/iceberg/hadoop/TestCachingCatalog.java
##########
@@ -252,9 +254,9 @@ public void 
testCacheExpirationEagerlyRemovesMetadataTables() throws IOException
     ticker.advance(HALF_OF_EXPIRATION);
     
Assertions.assertThat(catalog.cache().asMap()).doesNotContainKey(tableIdent);
 
-    Arrays.stream(metadataTables(tableIdent)).forEach(metadataTable ->
-        Assert.assertFalse("When a data table expires, its metadata tables 
should expire regardless of age",
-            catalog.cache().asMap().containsKey(metadataTable)));
+    // Removal of metadata tables from cache is async, use awaitility
+    await().untilAsserted(() ->
+        
Assertions.assertThat(catalog.cache().asMap()).doesNotContainKeys(metadataTables(tableIdent)));

Review comment:
       Great. Our work in the callback is relatively negligible (building a 
list of maybe at most 10 or so possible keys and calling invalidateAll with 
that list) and disabling async would be the desired behavior to reduce the 
possibility of users getting a stale associated value (the ones we’re 
invalidating in the callback). But it wouldn’t be the end of the world if they 
did. Really appreciate the input and knowledge sharing! 😊




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