Skip to content

Commit b99a67a

Browse files
author
Simon MacMullen
committed
Make this test aware that HA tests are running, it needs to assert a different value for the redelivered flag.
1 parent 3c298c3 commit b99a67a

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222
import junit.framework.TestSuite;
2323

2424
public class HATests extends TestSuite {
25+
public static boolean HA_TESTS_RUNNING = false;
26+
2527
public static TestSuite suite() {
2628
TestSuite suite = new TestSuite("server-tests");
2729
suite.addTestSuite(SetUp.class);
@@ -38,6 +40,7 @@ public static class SetUp extends TestCase {
3840
@Override
3941
protected void setUp() throws Exception {
4042
Host.executeCommand("cd ../rabbitmq-test; make enable-ha");
43+
HA_TESTS_RUNNING = true;
4144
}
4245

4346
public void testNothing() {}
@@ -47,6 +50,7 @@ public static class TearDown extends TestCase {
4750
@Override
4851
protected void tearDown() throws Exception {
4952
Host.executeCommand("cd ../rabbitmq-test; make disable-ha");
53+
HA_TESTS_RUNNING = false;
5054
}
5155

5256
public void testNothing() {}

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,10 @@ public void testMessageRecovery()
3434
waitForConfirms();
3535

3636
restart();
37-
assertDelivered(Q, 1);
37+
38+
// When testing in HA mode the message will be collected from a promoted
39+
// slave and wil have its redelivered flag set.
40+
assertDelivered(Q, 1, HATests.HA_TESTS_RUNNING);
3841
channel.queueDelete(Q);
3942
}
4043

0 commit comments

Comments
 (0)