Fix NonPersistentTopicTest test timeout was too short and sometimes failed
@@ -240,7 +240,6 @@ public class NonPersistentTopicTest extends ProducerConsumerBase {
*/
@Test
public void testProducerRateLimit() throws Exception {
-
int defaultNonPersistentMessageRate = conf.getMaxConcurrentNonPersistentMessagePerConnection();
try {
final String topic = "non-persistent://my-property/use/my-ns/unacked-topic";
@@ -260,8 +259,9 @@ public class NonPersistentTopicTest extends ProducerConsumerBase {
for (int i = 0; i < totalProduceMessages; i++) {
executor.submit(() -> {
try {
- producer.sendAsync(msgData).get(1, TimeUnit.SECONDS);
+ producer.send(msgData);
} catch (Exception e) {
+ log.error("Failed to send message", e);
failed.set(true);
}
latch.countDown();
@@ -290,7 +290,6 @@ public class NonPersistentTopicTest extends ProducerConsumerBase {
} finally {
conf.setMaxConcurrentNonPersistentMessagePerConnection(defaultNonPersistentMessageRate);
}
-
}
/**
