codelipenghui commented on code in PR #17045:
URL: https://github.com/apache/pulsar/pull/17045#discussion_r943084314
##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/ManagedCursorMetricsTest.java:
##########
@@ -197,9 +198,19 @@ public void testManagedCursorMetrics() throws Exception {
admin.topics().delete(topicName, true);
}
- @Test
+ private ManagedCursorMXBean getManagedCursorMXBean(String topicName,
String subscriptionName)
+ throws ExecutionException, InterruptedException {
+ final PersistentSubscription persistentSubscription =
+ (PersistentSubscription) pulsar.getBrokerService()
+ .getTopic(topicName,
false).get().get().getSubscription(subscriptionName);
+ final ManagedCursorImpl managedCursor = (ManagedCursorImpl)
persistentSubscription.getCursor();
+ return managedCursor.getStats();
+ }
+
+ @Test(timeOut = 2 * 1000)
Review Comment:
We can just use the default timeout? Or any reason to set it to 2 seconds
for this test? It might become flaky in the CI environment.
--
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]