This is an automated email from the ASF dual-hosted git repository.
clebertsuconic pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/activemq-artemis.git
The following commit(s) were added to refs/heads/main by this push:
new 33d2eec7f0 ARTEMIS-5173 Fixing flaky test SimpleOpenWireTest
33d2eec7f0 is described below
commit 33d2eec7f076ede98ffcdb66515aa408a6d257c0
Author: Clebert Suconic <[email protected]>
AuthorDate: Mon Dec 9 13:13:40 2024 -0500
ARTEMIS-5173 Fixing flaky test SimpleOpenWireTest
The advisory consumer will receive all the destinations previously created.
In an eventual the connection might miss the temporary destination from
another connection.
---
.../artemis/tests/integration/openwire/SimpleOpenWireTest.java | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git
a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SimpleOpenWireTest.java
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SimpleOpenWireTest.java
index 5ceade43e3..7ee594b08e 100644
---
a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SimpleOpenWireTest.java
+++
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/openwire/SimpleOpenWireTest.java
@@ -76,6 +76,7 @@ import
org.apache.activemq.artemis.core.transaction.impl.XidImpl;
import org.apache.activemq.artemis.spi.core.protocol.RemotingConnection;
import org.apache.activemq.artemis.tests.util.RandomUtil;
import org.apache.activemq.artemis.tests.util.Wait;
+import org.apache.activemq.command.ActiveMQDestination;
import org.apache.activemq.command.ActiveMQQueue;
import org.apache.activemq.command.ActiveMQTopic;
import org.apache.activemq.command.SessionInfo;
@@ -822,6 +823,8 @@ public class SimpleOpenWireTest extends BasicOpenWireTest {
try {
QueueSession newQueueSession = newConn.createQueueSession(false,
Session.AUTO_ACKNOWLEDGE);
QueueSender queueSender = newQueueSession.createSender(tempQueue);
+ // The advisory consumer is sending the notification to the client
about the temporary destinations asynchronously
+ Wait.assertFalse(() -> newConn.isDeleted((ActiveMQDestination)
tempQueue), 5000, 100);
Message msg = queueSession.createMessage();
queueSender.send(msg);
@@ -835,13 +838,20 @@ public class SimpleOpenWireTest extends BasicOpenWireTest
{
connection.close();
+ Wait.assertTrue(() -> newConn.isDeleted((ActiveMQDestination)
tempQueue), 5000, 100);
+
+ boolean failed = false;
+
try {
Message newMsg = newQueueSession.createMessage();
queueSender.send(newMsg);
} catch (JMSException e) {
+ failed = true;
//ok
}
+ assertTrue(failed);
+
} finally {
newConn.close();
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact