hudi-agent commented on code in PR #19394:
URL: https://github.com/apache/hudi/pull/19394#discussion_r3665185272


##########
hudi-flink-datasource/hudi-flink/src/test/java/org/apache/hudi/table/lookup/TestHoodieLookupFunction.java:
##########
@@ -98,6 +103,31 @@ void 
testLookupCacheDoesNotReloadWhenCompletedCommitHasNotChanged() throws Excep
     }
   }
 
+  @Test
+  void testRocksDBCacheLifecycleAndLookupFailure() throws Exception {
+    Configuration conf = getConf();
+    conf.set(FlinkOptions.LOOKUP_JOIN_CACHE_TYPE, "rocksdb");
+    conf.set(FlinkOptions.LOOKUP_JOIN_ROCKSDB_PATH, new File(tempFile, 
"rocksdb").getAbsolutePath());
+    StreamerUtil.initTableIfNotExists(conf);
+
+    HoodieLookupFunction function =
+        newLookupFunction(new 
CountingLookupTableReader(Collections.emptyList(), conf), conf);
+    function.open(null);
+
+    assertEquals(Duration.ofDays(1), function.getReloadInterval());
+    assertNull(function.lookup(lookupKey()));
+    function.close();
+
+    LookupCache failingCache = mock(LookupCache.class);
+    when(failingCache.getRows(any())).thenThrow(new IOException("expected"));
+    setCache(function, failingCache);
+    setNextLoadTime(function, Long.MAX_VALUE);

Review Comment:
   🤖 nit: could you use `assertInstanceOf(IOException.class, 
exception.getCause())` here? It gives a better failure message and matches how 
the async wrapper test handles the same pattern.
   
   <sub><i>⚠️ AI-generated; verify before applying. React 👍/👎 to flag 
quality.</i></sub>



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