lhotari commented on a change in pull request #9182:
URL: https://github.com/apache/pulsar/pull/9182#discussion_r555510986



##########
File path: 
pulsar-broker/src/test/java/org/apache/pulsar/client/api/SimpleProducerConsumerTest.java
##########
@@ -3692,4 +3693,88 @@ public void testGetStatsForPartitionedTopic() throws 
Exception {
         consumer.close();
         producer.close();
     }
+
+    @Test
+    public void testIncomingMessageSizeForNonPartitionedTopic() throws 
Exception {
+        final String topicName = 
"persistent://my-property/my-ns/testIncomingMessageSizeForNonPartitionedTopic-" 
+
+                UUID.randomUUID().toString();
+        final String subName = "my-sub";
+
+        @Cleanup
+        Consumer<byte[]> consumer = pulsarClient.newConsumer()
+                .topic(topicName)
+                .subscriptionName(subName)
+                .subscribe();
+
+        @Cleanup
+        Producer<byte[]> producer = pulsarClient.newProducer()
+                .topic(topicName)
+                .create();
+
+        final int messages = 100;
+        List<CompletableFuture<MessageId>> messageIds = new 
ArrayList<>(messages);
+        for (int i = 0; i < messages; i++) {
+            messageIds.add(producer.newMessage().value(("Message-" + 
i).getBytes()).sendAsync());
+        }
+        FutureUtil.waitForAll(messageIds).get();

Review comment:
       nitpick: in general, it's good to use timeouts in tests, for example 
using `.get(3, TimeUnit.SECONDS)`. However, I guess it's not very likely that 
sending would fail at this point, so the timeout isn't that relevant in this 
case. 




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

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to