Skip to content

Commit fe2585a

Browse files
committed
Remove use of ha-mode policy
Classic mirrored queues are deprecated in RabbitMQ 3.13 and gone in RabbitMQ 4.0, so we do not test them anymore.
1 parent a487563 commit fe2585a

File tree

5 files changed

+1
-142
lines changed

5 files changed

+1
-142
lines changed

src/test/java/com/rabbitmq/client/test/BrokerTestCase.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
public class BrokerTestCase {
3636

3737
private String brokerVersion;
38-
private boolean ha = false;
3938

4039
protected volatile TestInfo testInfo;
4140

@@ -343,10 +342,6 @@ private static String name(String prefix, Class<?> testClass, String testMethodN
343342
prefix, testClass.getSimpleName(), testMethodName, uuid.substring(uuid.length() / 2));
344343
}
345344

346-
protected boolean ha() {
347-
return this.ha;
348-
}
349-
350345
protected boolean beforeMessageContainers() {
351346
return versionCompare(this.brokerVersion, "3.13.0") < 0;
352347
}

src/test/java/com/rabbitmq/client/test/functional/Policies.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,6 @@ public class Policies extends BrokerTestCase {
180180
private final Set<String> policies = new HashSet<String>();
181181

182182
private void setPolicy(String name, String pattern, String definition) throws IOException {
183-
// We need to override the HA policy that we use in HATests, so
184-
// priority 1. But we still want a valid test of HA, so add the
185-
// ha-mode definition.
186-
if (ha()) {
187-
definition += ",\"ha-mode\":\"all\"";
188-
}
189183
Host.rabbitmqctl("set_policy --priority 1 " + name + " " + pattern +
190184
" {" + escapeDefinition(definition) + "}");
191185
policies.add(name);

src/test/java/com/rabbitmq/client/test/server/AbsentQueue.java

Lines changed: 0 additions & 108 deletions
This file was deleted.

src/test/java/com/rabbitmq/client/test/server/DeadLetterExchangeDurable.java

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,9 +50,6 @@ protected void releaseResources() throws IOException {
5050
}
5151

5252
@Test public void deadLetterQueueTTLExpiredWhileDown() throws Exception {
53-
// This test is nonsensical (and often breaks) in HA mode.
54-
if (ha()) return;
55-
5653
for(int x = 0; x < DeadLetterExchange.MSG_COUNT; x++) {
5754
channel.basicPublish("amq.direct", "test", MessageProperties.MINIMAL_PERSISTENT_BASIC, "test message".getBytes());
5855
}

src/test/java/com/rabbitmq/client/test/server/MessageRecovery.java

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -46,26 +46,7 @@ public class MessageRecovery extends ConfirmBase
4646

4747
restart();
4848

49-
// When testing in HA mode the message will be collected from
50-
// a promoted slave and will have its redelivered flag
51-
// set. But that only happens if there actually *is* a
52-
// slave. We test that by passively declaring, and
53-
// subsequently deleting, the secondary, non-durable queue,
54-
// which only succeeds if the queue survived the restart,
55-
// which in turn implies that it must have been a HA queue
56-
// with slave(s).
57-
// NB: this wont work when running against a single node broker
58-
// and running the test individually outside of the HA suite
59-
boolean expectDelivered = ha();
60-
try {
61-
channel.queueDeclarePassive(Q2);
62-
channel.queueDelete(Q2);
63-
expectDelivered = true;
64-
} catch (IOException e) {
65-
checkShutdownSignal(AMQP.NOT_FOUND, e);
66-
openChannel();
67-
}
68-
assertDelivered(Q, 1, expectDelivered);
49+
assertDelivered(Q, 1, false);
6950
channel.queueDelete(Q);
7051
channel.queueDelete(Q2);
7152
}

0 commit comments

Comments
 (0)