You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "zymap (via GitHub)" <gi...@apache.org> on 2023/08/21 00:49:52 UTC

[GitHub] [pulsar] zymap commented on a diff in pull request #21032: [fix][client] Fix RawReader hasMessageAvailable returns true when no messages

zymap commented on code in PR #21032:
URL: https://github.com/apache/pulsar/pull/21032#discussion_r1299474266


##########
pulsar-broker/src/test/java/org/apache/pulsar/client/impl/RawReaderTest.java:
##########
@@ -133,20 +137,18 @@ public void testHasMessageAvailableWithoutBatch() throws Exception {
             }
         }
         Assert.assertTrue(keys.isEmpty());
+        reader.closeAsync().get(3, TimeUnit.SECONDS);
     }
 
     @Test
     public void testHasMessageAvailableWithBatch() throws Exception {
         int numKeys = 20;
-        String topic = "persistent://my-property/my-ns/my-raw-topic";
+        String topic = "persistent://my-property/my-ns/" + BrokerTestUtil.newUniqueName("reader");
         Set<String> keys = publishMessages(topic, numKeys, true);
         RawReader reader = RawReader.create(pulsarClient, topic, subscription).get();
         int messageCount = 0;
         while (true) {
             boolean hasMsg = reader.hasMessageAvailableAsync().get();
-            if (hasMsg && (messageCount == numKeys)) {

Review Comment:
   Why removed the original checks? It changes the original testing purpose, no?



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