Skip to content

Commit de49971

Browse files
committed
Disable auto recovery in DeadLetterExchange test
Fixes #210
1 parent 9643643 commit de49971

File tree

3 files changed

+18
-4
lines changed

3 files changed

+18
-4
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,9 +60,14 @@ protected void finished(Description description) {
6060

6161
protected ConnectionFactory newConnectionFactory() {
6262
ConnectionFactory connectionFactory = TestUtils.connectionFactory();
63+
connectionFactory.setAutomaticRecoveryEnabled(isAutomaticRecoveryEnabled());
6364
return connectionFactory;
6465
}
6566

67+
protected boolean isAutomaticRecoveryEnabled() {
68+
return true;
69+
}
70+
6671
protected Connection connection;
6772
protected Channel channel;
6873

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ public class DeadLetterExchange extends BrokerTestCase {
5555
public static final int MSG_COUNT = 10;
5656
public static final int TTL = 1000;
5757

58+
@Override
59+
protected boolean isAutomaticRecoveryEnabled() {
60+
return false;
61+
}
62+
5863
@Override
5964
protected void createResources() throws IOException {
6065
channel.exchangeDelete(DLX);
@@ -164,10 +169,6 @@ protected void releaseResources() throws IOException {
164169

165170
args.put(DLX_RK_ARG, "foo");
166171

167-
// sleep a little, otherwise the resource is still locked
168-
// before the next call and we get a 405 - resource locked
169-
Thread.sleep(100L);
170-
171172
channel.queueDeclare("bar", false, true, false, args);
172173
fail("x-dead-letter-exchange must be specified if " +
173174
"x-dead-letter-routing-key is set");

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,14 @@
3333
*/
3434
public class ExclusiveQueueDurability extends BrokerTestCase {
3535

36+
@Override
37+
protected boolean isAutomaticRecoveryEnabled() {
38+
// With automatic recovery enabled, queue can be re-created when launching the test suite
39+
// (because FunctionalTests are launched independently and as part of the HATests)
40+
// This then makes this test fail.
41+
return false;
42+
}
43+
3644
void verifyQueueMissing(Channel channel, String queueName)
3745
throws IOException {
3846
try {

0 commit comments

Comments
 (0)