You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "ZhaoGuorui666 (via GitHub)" <gi...@apache.org> on 2024/10/30 13:56:14 UTC

[PR] solve issue#23485 [pulsar]

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

   Fixes #23485
   
   ### Motivation
   
   `Awaitility.await().untilAsserted(() -> assertNull(consumer.receive(RECEIVE_TIMEOUT_SECONDS, TimeUnit.SECONDS)));
   `
   The problem lies in this line of code. Through the logs, it can be seen that the exception situation is two calls to consumer. receive. The first call obtains null, and after the successful assertion returns, the second call will receive a message, resulting in one less total call.
   
   ![image](https://github.com/user-attachments/assets/36aa3738-6368-4d65-91d0-fbfeb8589c15)
   
   ![企业微信截图_17302904118685](https://github.com/user-attachments/assets/6af77600-0503-4c4e-b39b-aae1830ef27e)
   
   
   ### Modifications
   
   Change assertion related code
   
   ### Verifying this change
   
   ![企业微信截图_17302951303412](https://github.com/user-attachments/assets/b61fb0e1-6631-4b25-b0ab-5e4dd2ba3f1b)
   
   ### Documentation
   
   - [ ] `doc` 
   - [ ] `doc-required` 
   - [x] `doc-not-needed` 
   - [ ] `doc-complete` 
   


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


Re: [PR] [fix][test] Fix SimpleProducerConsumerTest.testMultiTopicsConsumerImplPauseForManualSubscription [pulsar]

Posted by "ZhaoGuorui666 (via GitHub)" <gi...@apache.org>.
ZhaoGuorui666 closed pull request #23531: [fix][test] Fix SimpleProducerConsumerTest.testMultiTopicsConsumerImplPauseForManualSubscription 
URL: https://github.com/apache/pulsar/pull/23531


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


Re: [PR] [fix][test] Fix SimpleProducerConsumerTest.testMultiTopicsConsumerImplPauseForManualSubscription [pulsar]

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


##########
pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleProducerConsumerTest.java:
##########
@@ -3557,7 +3557,8 @@ public void testMultiTopicsConsumerImplPauseForManualSubscription() throws Excep
         }
 
         // 6. should not consume any messages
-        Awaitility.await().untilAsserted(() -> assertNull(consumer.receive(RECEIVE_TIMEOUT_SECONDS, TimeUnit.SECONDS)));
+        Message<byte[]> msg = consumer.receive(2, TimeUnit.SECONDS);

Review Comment:
   there's already several constants for timeouts. Perhaps `receive(RECEIVE_TIMEOUT_MEDIUM_MILLIS, TimeUnit.MILLISECONDS)` could be used instead.



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