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/10 15:00:20 UTC

[GitHub] [pulsar] poorbarcode opened a new pull request, #17045: [fix][flaky-test]ManagedCursorMetricsTest.testCursorReadWriteMetrics

poorbarcode opened a new pull request, #17045:
URL: https://github.com/apache/pulsar/pull/17045

   Fixes #16948
   
   Master Issue: #16948
   
   ### Motivation
   
   This test is flaky because that BK has not been successfully written when the asset executed
   
   https://github.com/apache/pulsar/blob/e5d5fbe5d023d9df0bf47e73186f3203a1f07c42/pulsar-broker/src/test/java/org/apache/pulsar/broker/stats/ManagedCursorMetricsTest.java#L244-L248
   
   ### Modifications
   
   Makes assert execute after BK written
   
   ### Documentation
   
   - [ ] `doc-required` 
   (Your PR needs to update docs and you will update later)
     
   - [x] `doc-not-needed` 
   (Please explain why)
     
   - [ ] `doc` 
   (Your PR contains doc changes)
   
   - [ ] `doc-complete`
   (Docs have been already added)


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


[GitHub] [pulsar] poorbarcode commented on a diff in pull request #17045: [fix][flaky-test]ManagedCursorMetricsTest.testCursorReadWriteMetrics

Posted by GitBox <gi...@apache.org>.
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


[GitHub] [pulsar] codelipenghui merged pull request #17045: [fix][flaky-test]ManagedCursorMetricsTest.testCursorReadWriteMetrics

Posted by GitBox <gi...@apache.org>.
codelipenghui merged PR #17045:
URL: https://github.com/apache/pulsar/pull/17045


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


[GitHub] [pulsar] poorbarcode commented on pull request #17045: [fix][flaky-test]ManagedCursorMetricsTest.testCursorReadWriteMetrics

Posted by GitBox <gi...@apache.org>.
poorbarcode commented on PR #17045:
URL: https://github.com/apache/pulsar/pull/17045#issuecomment-1212078719

   /pulsarbot rerun-failure-checks


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


[GitHub] [pulsar] poorbarcode commented on pull request #17045: [fix][flaky-test]ManagedCursorMetricsTest.testCursorReadWriteMetrics

Posted by GitBox <gi...@apache.org>.
poorbarcode commented on PR #17045:
URL: https://github.com/apache/pulsar/pull/17045#issuecomment-1212234250

   /pulsarbot rerun-failure-checks


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


[GitHub] [pulsar] codelipenghui commented on a diff in pull request #17045: [fix][flaky-test]ManagedCursorMetricsTest.testCursorReadWriteMetrics

Posted by GitBox <gi...@apache.org>.
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


[GitHub] [pulsar] poorbarcode commented on pull request #17045: [fix][flaky-test]ManagedCursorMetricsTest.testCursorReadWriteMetrics

Posted by GitBox <gi...@apache.org>.
poorbarcode commented on PR #17045:
URL: https://github.com/apache/pulsar/pull/17045#issuecomment-1212078244

   /pulsarbot rerun-failure-checks


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