congbobo184 commented on code in PR #20951:
URL: https://github.com/apache/pulsar/pull/20951#discussion_r1294155324
##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BacklogQuotaManagerTest.java:
##########
@@ -1186,9 +1191,12 @@ public void
testProducerExceptionAndThenUnblockSizeQuota() throws Exception {
boolean gotException = false;
Consumer<byte[]> consumer =
client.newConsumer().topic(topic1).subscriptionName(subName1).subscribe();
-
byte[] content = new byte[1024];
Producer<byte[]> producer = createProducer(client, topic1);
+
+ admin.topicPolicies().setDeduplicationStatus(topic1, dedupTestSet);
+ Thread.sleep((TIME_TO_CHECK_BACKLOG_QUOTA + 1) * 1000);
Review Comment:
better use admin to instead of sleep
##########
pulsar-broker/src/test/java/org/apache/pulsar/broker/service/BacklogQuotaManagerTest.java:
##########
@@ -1223,14 +1232,33 @@ public void
testProducerExceptionAndThenUnblockSizeQuota() throws Exception {
Exception sendException = null;
gotException = false;
try {
- for (int i = 0; i < 5; i++) {
+ for (int i = 0; i < 10; i++) {
producer.send(content);
+ Message<?> msg = consumer.receive();
+ consumer.acknowledge(msg);
}
} catch (Exception e) {
gotException = true;
sendException = e;
}
+ Thread.sleep((TIME_TO_CHECK_BACKLOG_QUOTA + 1) * 1000);
assertFalse(gotException, "unable to publish due to " + sendException);
+
+ gotException = false;
Review Comment:
don't need this line
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]