NO-JIRA fixing intermittent test failure on MaxMessagePagingTest

This commit is contained in:
Clebert Suconic 2024-05-28 20:57:37 -04:00
parent acc64b184e
commit 0ca36b7b38
1 changed files with 4 additions and 3 deletions

View File

@ -459,7 +459,7 @@ public class MaxMessagesPagingTest extends ActiveMQTestBase {
private void internalBlockMaxMessages(String protocolSend, String protocolReceive, ActiveMQServer server, boolean global) throws Exception { private void internalBlockMaxMessages(String protocolSend, String protocolReceive, ActiveMQServer server, boolean global) throws Exception {
final int MESSAGES = 1000; final int MESSAGES = 1200;
logger.info("\n{}\nSending {}, Receiving {}\n{}", "*".repeat(80), protocolSend, protocolReceive, "*".repeat(80)); logger.info("\n{}\nSending {}, Receiving {}\n{}", "*".repeat(80), protocolSend, protocolReceive, "*".repeat(80));
@ -496,8 +496,9 @@ public class MaxMessagesPagingTest extends ActiveMQTestBase {
try { try {
Session session = connSend.createSession(false, Session.AUTO_ACKNOWLEDGE); Session session = connSend.createSession(false, Session.AUTO_ACKNOWLEDGE);
MessageProducer producer = session.createProducer(session.createQueue(ADDRESS)); MessageProducer producer = session.createProducer(session.createQueue(ADDRESS));
producer.setDeliveryMode(DeliveryMode.PERSISTENT); producer.setDeliveryMode(protocolSend.equals("OPENWIRE") ? DeliveryMode.PERSISTENT : DeliveryMode.NON_PERSISTENT);
for (int i = 0; i < MESSAGES; i++) { for (int i = 0; i < MESSAGES; i++) {
logger.debug("Sending {} protocol {}", i, protocolSend);
producer.send(session.createTextMessage("OK!" + i)); producer.send(session.createTextMessage("OK!" + i));
} }
session.close(); session.close();
@ -511,7 +512,7 @@ public class MaxMessagesPagingTest extends ActiveMQTestBase {
Wait.assertTrue(() -> loggerHandler.findText("AMQ222183"), 5000, 10); //unblock Wait.assertTrue(() -> loggerHandler.findText("AMQ222183"), 5000, 10); //unblock
Assert.assertFalse(loggerHandler.findText("AMQ221046")); // should not been unblocked Assert.assertFalse(loggerHandler.findText("AMQ221046")); // should not been unblocked
Assert.assertFalse(done.await(100, TimeUnit.MILLISECONDS)); Assert.assertFalse(done.await(200, TimeUnit.MILLISECONDS));
} }
try (AssertionLoggerHandler loggerHandler = new AssertionLoggerHandler()) { try (AssertionLoggerHandler loggerHandler = new AssertionLoggerHandler()) {