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 04:21:51 UTC
[GitHub] [pulsar] codelipenghui commented on a diff in pull request #17045: [fix][flaky-test]ManagedCursorMetricsTest.testCursorReadWriteMetrics
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org