kfaraz commented on code in PR #12397:
URL: https://github.com/apache/druid/pull/12397#discussion_r851939810
##########
extensions-core/lookups-cached-global/src/test/java/org/apache/druid/server/lookup/namespace/cache/CacheSchedulerTest.java:
##########
@@ -412,6 +420,62 @@ public void testEntryCloseForgotten() throws
InterruptedException
Assert.assertEquals(0, scheduler.getActiveEntries());
}
+ @Test(timeout = 60_000L)
+ public void testSimpleSubmissionSuccessWithWait() throws InterruptedException
+ {
+ UriExtractionNamespace namespace = new UriExtractionNamespace(
+ tmpFile.toURI(),
+ null, null,
+ new UriExtractionNamespace.ObjectMapperFlatDataParser(
+ UriExtractionNamespaceTest.registerTypes(new ObjectMapper())
+ ),
+ new Period(0),
+ null,
+ null
+ );
+ CacheScheduler.Entry entry = scheduler.scheduleAndWait(namespace, 10_000L);
+ waitFor(entry);
+ Assert.assertEquals(VALUE, entry.getCache().get(KEY));
+ }
+
+
+ @Test(timeout = 20_000L)
+ public void testSimpleSubmissionFailureWithWait() throws InterruptedException
Review Comment:
Do we need to add an expected exception for this test or an assertThrows?
Currently, it just seems to be scheduling a lookup extraction but not
asserting anything.
##########
extensions-core/lookups-cached-global/src/test/java/org/apache/druid/server/lookup/namespace/cache/CacheSchedulerTest.java:
##########
@@ -412,6 +420,62 @@ public void testEntryCloseForgotten() throws
InterruptedException
Assert.assertEquals(0, scheduler.getActiveEntries());
}
+ @Test(timeout = 60_000L)
+ public void testSimpleSubmissionSuccessWithWait() throws InterruptedException
+ {
+ UriExtractionNamespace namespace = new UriExtractionNamespace(
+ tmpFile.toURI(),
+ null, null,
+ new UriExtractionNamespace.ObjectMapperFlatDataParser(
+ UriExtractionNamespaceTest.registerTypes(new ObjectMapper())
+ ),
+ new Period(0),
+ null,
+ null
+ );
+ CacheScheduler.Entry entry = scheduler.scheduleAndWait(namespace, 10_000L);
+ waitFor(entry);
+ Assert.assertEquals(VALUE, entry.getCache().get(KEY));
+ }
+
+
+ @Test(timeout = 20_000L)
+ public void testSimpleSubmissionFailureWithWait() throws InterruptedException
+ {
+ JdbcExtractionNamespace namespace = new JdbcExtractionNamespace(
+ new MetadataStorageConnectorConfig()
Review Comment:
Nit: I guess you could use the static
`MetadataStorageConnectorConfig.create()` instead.
--
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]