This is an automated email from the ASF dual-hosted git repository.

tabish 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 771a2f5d90 ARTEMIS-5437 Tweak test to fix intermittent CI failures
771a2f5d90 is described below

commit 771a2f5d90395ca664cdf9c45a6354e694d55259
Author: Timothy Bish <[email protected]>
AuthorDate: Wed Apr 23 14:37:05 2025 -0400

    ARTEMIS-5437 Tweak test to fix intermittent CI failures
    
    Make a few changes to a test that is failing in CI intermittently.
---
 .../amqp/connect/AMQPBridgeToAddressTest.java      | 44 ++++++++++------------
 1 file changed, 20 insertions(+), 24 deletions(-)

diff --git 
a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPBridgeToAddressTest.java
 
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPBridgeToAddressTest.java
index 7527497237..9e8bb8f023 100644
--- 
a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPBridgeToAddressTest.java
+++ 
b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPBridgeToAddressTest.java
@@ -141,7 +141,7 @@ class AMQPBridgeToAddressTest  extends 
AmqpClientTestSupport {
 
          final AMQPBridgeAddressPolicyElement sendToAddress = new 
AMQPBridgeAddressPolicyElement();
          sendToAddress.setName("address-policy");
-         sendToAddress.addToIncludes(getTestName());
+         sendToAddress.addToIncludes(getTestName() + ".#");
 
          final AMQPBridgeBrokerConnectionElement element = new 
AMQPBridgeBrokerConnectionElement();
          element.setName(getTestName());
@@ -150,6 +150,7 @@ class AMQPBridgeToAddressTest  extends 
AmqpClientTestSupport {
          final AMQPBrokerConnectConfiguration amqpConnection =
             new AMQPBrokerConnectConfiguration(getTestName(), "tcp://" + 
remoteURI.getHost() + ":" + remoteURI.getPort());
          amqpConnection.setReconnectAttempts(1);
+         amqpConnection.setRetryInterval(10);
          amqpConnection.addElement(element);
 
          server.getConfiguration().addAMQPConnection(amqpConnection);
@@ -157,19 +158,19 @@ class AMQPBridgeToAddressTest  extends 
AmqpClientTestSupport {
 
          peer.waitForScriptToComplete(5, TimeUnit.SECONDS);
          peer.expectAttach().ofSender()
-                            .withTarget().withAddress(getTestName()).also()
-                            .withSource().withAddress(getTestName()).also()
-                            .withName(allOf(containsString(getTestName()),
+                            .withTarget().withAddress(getTestName() + 
".1").also()
+                            .withSource().withAddress(getTestName() + 
".1").also()
+                            .withName(allOf(containsString(getTestName() + 
".1"),
                                             containsString("address-sender"),
                                             containsString("amqp-bridge"),
                                             
containsString(server.getNodeID().toString())))
                             .respond();
          peer.remoteFlow().withLinkCredit(1).queue();
 
-         server.addAddressInfo(new AddressInfo(SimpleString.of(getTestName()), 
RoutingType.MULTICAST));
+         server.addAddressInfo(new AddressInfo(SimpleString.of(getTestName() + 
".1"), RoutingType.MULTICAST));
 
-         Wait.assertTrue(() -> 
server.addressQuery(SimpleString.of(getTestName())).isExists());
-         Wait.assertTrue(() -> 
server.bindingQuery(SimpleString.of(getTestName())).getQueueNames().size() > 0);
+         Wait.assertTrue(() -> 
server.addressQuery(SimpleString.of(getTestName() + ".1")).isExists());
+         Wait.assertTrue(() -> 
server.bindingQuery(SimpleString.of(getTestName() + 
".1")).getQueueNames().size() > 0);
 
          peer.waitForScriptToComplete(5, TimeUnit.SECONDS);
          peer.expectDetach().respond();
@@ -178,35 +179,30 @@ class AMQPBridgeToAddressTest  extends 
AmqpClientTestSupport {
          // should be the thing that triggers the bridging. The connection 
should remain active and
          // respond if the address is recreated later.
          logger.info("Removing Address from bridged address to eliminate 
sender");
-         server.removeAddressInfo(SimpleString.of(getTestName()), null, true);
-
-         peer.waitForScriptToComplete(5, TimeUnit.SECONDS);
+         server.removeAddressInfo(SimpleString.of(getTestName() + ".1"), null, 
true);
 
          Wait.assertFalse(() -> 
server.addressQuery(SimpleString.of(getTestName())).isExists());
 
+         peer.waitForScriptToComplete(5, TimeUnit.SECONDS);
+
+         peer.waitForScriptToComplete(5, TimeUnit.SECONDS);
          peer.expectAttach().ofSender()
-                            .withTarget().withAddress(getTestName()).also()
-                            .withSource().withAddress(getTestName()).also()
-                            .withName(allOf(containsString(getTestName()),
+                            .withTarget().withAddress(getTestName() + 
".2").also()
+                            .withSource().withAddress(getTestName() + 
".2").also()
+                            .withName(allOf(containsString(getTestName() + 
".2"),
                                             containsString("address-sender"),
                                             containsString("amqp-bridge"),
                                             
containsString(server.getNodeID().toString())))
                             .respond();
          peer.remoteFlow().withLinkCredit(1).queue();
 
-         final ConnectionFactory factory = 
CFUtil.createConnectionFactory("AMQP", "tcp://localhost:" + AMQP_PORT);
-
-         // Producer connect should create the address and initiate the bridge 
sender attach
-         try (Connection connection = factory.createConnection()) {
-            final Session session = 
connection.createSession(Session.AUTO_ACKNOWLEDGE);
-            session.createProducer(session.createTopic(getTestName()));
-
-            Wait.assertTrue(() -> 
server.addressQuery(SimpleString.of(getTestName())).isExists());
-            Wait.assertTrue(() -> 
server.bindingQuery(SimpleString.of(getTestName())).getQueueNames().size() > 0);
+         // Add another address that matches the filter and the bridge should 
form without a reconnect.
+         server.addAddressInfo(new AddressInfo(SimpleString.of(getTestName() + 
".2"), RoutingType.MULTICAST));
 
-            peer.waitForScriptToComplete(5, TimeUnit.SECONDS);
-         }
+         Wait.assertTrue(() -> 
server.addressQuery(SimpleString.of(getTestName() + ".2")).isExists());
+         Wait.assertTrue(() -> 
server.bindingQuery(SimpleString.of(getTestName() + 
".2")).getQueueNames().size() > 0);
 
+         peer.waitForScriptToComplete(5, TimeUnit.SECONDS);
          peer.close();
       }
    }


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact


Reply via email to