Praveenkumar76 commented on code in PR #25590:
URL: https://github.com/apache/pulsar/pull/25590#discussion_r3152282421


##########
tests/integration/src/test/java/org/apache/pulsar/tests/integration/functions/PulsarFunctionsTest.java:
##########
@@ -363,17 +359,31 @@ protected void testWindowFunction(String type, String[] 
expectedResults) throws
         assertThat(i).isGreaterThanOrEqualTo(expectedResults.length - 1);
 
         // test that all messages are acked
-        stats = pulsarAdmin.topics().getStats(inputTopicName, true);
-        subStats = stats.getSubscriptions().get("public/default/" + 
functionName);
-        assertNotNull(subStats);
-        assertEquals(0, subStats.getMsgBacklog());
-        assertEquals(0, subStats.getUnackedMessages());
+        awaitAndVerifySubscriptionStats(inputTopicName, functionName, 0, 0);
 
         deleteFunction(functionName);
 
         getFunctionInfoNotFound(functionName);
     }
 
+    private void awaitAndVerifySubscriptionStats(String inputTopicName, String 
functionName, int expectedBacklog,
+                                                 int expectedUnacked) {
+        Awaitility.await()
+                // Check every 50ms
+                .pollInterval(Duration.ofMillis(50))

Review Comment:
   Understood, I initially set it to 50ms hoping for slightly faster execution, 
but I agree the default 100ms is perfectly sufficient. I'll remove this



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