walkinggo commented on code in PR #23811:
URL: https://github.com/apache/pulsar/pull/23811#discussion_r1913347928
##########
pulsar-functions/instance/src/test/java/org/apache/pulsar/functions/instance/JavaInstanceRunnableTest.java:
##########
@@ -173,6 +178,20 @@ public Void process(String input, Context context) throws
Exception {
}
}
+ @Test
+ public void testFunctionAsyncTime() throws Exception {
+ JavaInstanceRunnable runnable =
+
createRunnable(FunctionDetails.newBuilder().setClassName(TestFunction.class.getName()).build());
+ Instant before = Instant.now();
+ Instant join = CompletableFuture.supplyAsync(() -> {
+ new Thread(runnable).start();
+ return Instant.now();
+ }).join();
+ assertThat(join).isNotNull();
+ Duration duration = Duration.between(before, join);
+ assertThat(duration.toMillis()).isLessThan(20);
Review Comment:
I have made the changes. Is it okay now?
--
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]