File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
test/src/com/rabbitmq/client/test/server Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff 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 ());
You can’t perform that action at this time.
0 commit comments