lhotari commented on code in PR #23811:
URL: https://github.com/apache/pulsar/pull/23811#discussion_r1913037568


##########
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:
   this assertion seems pointless. It would be more meaningful to validate 
calls to `processTimeEnd`. 



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