You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/08/11 06:27:28 UTC
[GitHub] [pulsar] poorbarcode commented on a diff in pull request #17045: [fix][flaky-test]ManagedCursorMetricsTest.testCursorReadWriteMetrics
poorbarcode commented on code in PR #17045:
URL: https://github.com/apache/pulsar/pull/17045#discussion_r943132554
##########
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:
> Or any reason to set it to 2 seconds for this test?
no
> We can just use the default timeout?
already change to default timeout.
--
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org