Skip to content

Commit fa32e7b

Browse files
committed
test disabling of heartbeat monitoring
1 parent f682c3c commit fa32e7b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ public class MemoryAlarms extends BrokerTestCase {
5353
protected void setUp()
5454
throws IOException
5555
{
56+
connectionFactory.setRequestedHeartbeat(1);
5657
super.setUp();
5758
if (connection2 == null) {
5859
connection2 = connectionFactory.newConnection();
@@ -73,6 +74,7 @@ protected void tearDown()
7374
connection2 = null;
7475
}
7576
super.tearDown();
77+
connectionFactory.setRequestedHeartbeat(0);
7678
}
7779

7880
@Override
@@ -113,6 +115,8 @@ public void testFlowControl()
113115
//publishes after an alarm should not go through
114116
basicPublishVolatile(Q);
115117
assertNull(c.nextDelivery(10)); //the publish is async, so this is racy
118+
//heartbeat monitoring should be disabled
119+
Thread.sleep(3100); //3x heartbeat interval + epsilon
116120
//once the alarm has cleared the publishes should go through
117121
clearMemoryAlarm();
118122
assertNotNull(c.nextDelivery());

0 commit comments

Comments
 (0)