You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "lhotari (via GitHub)" <gi...@apache.org> on 2023/05/24 11:36:38 UTC

[GitHub] [pulsar] lhotari opened a new pull request, #20387: [fix][test] Fix flaky test NonPersistentTopicTest.testMsgDropStat

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

   Fixes #20386
   
   ### Motivation
   
   See #20386
   
   ### Modifications
   
   Use Awaitility in test. Consume and acknowledge messages with messageListener.
   
   ### Documentation
   
   <!-- DO NOT REMOVE THIS SECTION. CHECK THE PROPER BOX ONLY. -->
   
   - [ ] `doc` <!-- Your PR contains doc changes. -->
   - [ ] `doc-required` <!-- Your PR changes impact docs and you will update later -->
   - [x] `doc-not-needed` <!-- Your PR changes do not impact docs -->
   - [ ] `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] lhotari commented on a diff in pull request #20387: [fix][test] Fix flaky test NonPersistentTopicTest.testMsgDropStat

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on code in PR #20387:
URL: https://github.com/apache/pulsar/pull/20387#discussion_r1204265636


##########
pulsar-broker/src/test/java/org/apache/pulsar/client/api/NonPersistentTopicTest.java:
##########
@@ -824,10 +825,12 @@ public void testMsgDropStat() throws Exception {
             stopBroker();
             startBroker();
             Consumer<byte[]> consumer = pulsarClient.newConsumer().topic(topicName).subscriptionName("subscriber-1")
-                    .receiverQueueSize(1).subscribe();
+                    .receiverQueueSize(1)
+                    .messageListener((c, msg) -> {}).subscribe();

Review Comment:
   My assumption is that it's a better simulation of a real application than a subscription that doesn't consume messages.



-- 
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] lhotari commented on a diff in pull request #20387: [fix][test] Fix flaky test NonPersistentTopicTest.testMsgDropStat

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on code in PR #20387:
URL: https://github.com/apache/pulsar/pull/20387#discussion_r1204268408


##########
pulsar-broker/src/test/java/org/apache/pulsar/client/api/NonPersistentTopicTest.java:
##########
@@ -824,10 +825,12 @@ public void testMsgDropStat() throws Exception {
             stopBroker();
             startBroker();
             Consumer<byte[]> consumer = pulsarClient.newConsumer().topic(topicName).subscriptionName("subscriber-1")
-                    .receiverQueueSize(1).subscribe();
+                    .receiverQueueSize(1)
+                    .messageListener((c, msg) -> {}).subscribe();

Review Comment:
   Maybe it doesn't acknowledge by default... well, it will at least consume the messages.



-- 
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] tisonkun commented on a diff in pull request #20387: [fix][test] Fix flaky test NonPersistentTopicTest.testMsgDropStat

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on code in PR #20387:
URL: https://github.com/apache/pulsar/pull/20387#discussion_r1203962211


##########
pulsar-broker/src/test/java/org/apache/pulsar/client/api/NonPersistentTopicTest.java:
##########
@@ -824,10 +825,12 @@ public void testMsgDropStat() throws Exception {
             stopBroker();
             startBroker();
             Consumer<byte[]> consumer = pulsarClient.newConsumer().topic(topicName).subscriptionName("subscriber-1")
-                    .receiverQueueSize(1).subscribe();
+                    .receiverQueueSize(1)
+                    .messageListener((c, msg) -> {}).subscribe();

Review Comment:
   Why a dummy message listener is necessary here?



-- 
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] tisonkun merged pull request #20387: [fix][test] Fix flaky test NonPersistentTopicTest.testMsgDropStat

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun merged PR #20387:
URL: https://github.com/apache/pulsar/pull/20387


-- 
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] lhotari commented on a diff in pull request #20387: [fix][test] Fix flaky test NonPersistentTopicTest.testMsgDropStat

Posted by "lhotari (via GitHub)" <gi...@apache.org>.
lhotari commented on code in PR #20387:
URL: https://github.com/apache/pulsar/pull/20387#discussion_r1204263984


##########
pulsar-broker/src/test/java/org/apache/pulsar/client/api/NonPersistentTopicTest.java:
##########
@@ -824,10 +825,12 @@ public void testMsgDropStat() throws Exception {
             stopBroker();
             startBroker();
             Consumer<byte[]> consumer = pulsarClient.newConsumer().topic(topicName).subscriptionName("subscriber-1")
-                    .receiverQueueSize(1).subscribe();
+                    .receiverQueueSize(1)
+                    .messageListener((c, msg) -> {}).subscribe();

Review Comment:
   It might not be necessary, but it will consume and acknowledge messages. 



-- 
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] tisonkun commented on pull request #20387: [fix][test] Fix flaky test NonPersistentTopicTest.testMsgDropStat

Posted by "tisonkun (via GitHub)" <gi...@apache.org>.
tisonkun commented on PR #20387:
URL: https://github.com/apache/pulsar/pull/20387#issuecomment-1561551213

   Merging...
   
   Thank you!


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