From aab1c484b211c7efb76aae3d2a1d9ddbe3f16067 Mon Sep 17 00:00:00 2001 From: Timothy Bish Date: Tue, 28 May 2024 14:26:17 -0400 Subject: [PATCH] NO-JIRA Fix a few cases of federation test fails on unexpected frames Add a couple optional flags for performatives that might arrive based on the timing of connection close or remote detach etc. --- .../amqp/connect/AMQPFederationAddressPolicyTest.java | 2 +- .../integration/amqp/connect/AMQPFederationConnectTest.java | 1 + .../integration/amqp/connect/AMQPFederationQueuePolicyTest.java | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationAddressPolicyTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationAddressPolicyTest.java index 6e82e370b9..d71e3d95f2 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationAddressPolicyTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationAddressPolicyTest.java @@ -3234,7 +3234,7 @@ public class AMQPFederationAddressPolicyTest extends AmqpClientTestSupport { peer.remoteDetach().withClosed(true) .withErrorCondition(AmqpError.NOT_FOUND.toString(), "Address not found") .queue(); - peer.expectFlow(); + peer.expectFlow().optional(); peer.expectDetach(); // Triggers the initial attach based on demand. diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationConnectTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationConnectTest.java index 13ddb976be..329093995a 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationConnectTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationConnectTest.java @@ -209,6 +209,7 @@ public class AMQPFederationConnectTest extends AmqpClientTestSupport { peer.expectOpen().respond(); peer.expectBegin().respond(); peer.expectAttach().ofSender().withDesiredCapability(FEDERATION_CONTROL_LINK.toString()).respond(); + peer.expectClose().optional(); // Can sometimes be sent peer.expectConnectionToDrop(); peer.start(); diff --git a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationQueuePolicyTest.java b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationQueuePolicyTest.java index f32e032c4a..baa9b0dab5 100644 --- a/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationQueuePolicyTest.java +++ b/tests/integration-tests/src/test/java/org/apache/activemq/artemis/tests/integration/amqp/connect/AMQPFederationQueuePolicyTest.java @@ -3476,7 +3476,7 @@ public class AMQPFederationQueuePolicyTest extends AmqpClientTestSupport { peer.remoteDetach().withClosed(true) .withErrorCondition(AmqpError.NOT_FOUND.toString(), "Queue not found") .queue(); - peer.expectFlow(); + peer.expectFlow().optional(); peer.expectDetach(); final ConnectionFactory factory = CFUtil.createConnectionFactory("AMQP", "tcp://localhost:" + AMQP_PORT);