Skip to content

Commit 1481a28

Browse files
author
Matthew Sackman
committed
Combine elements of test to make test more robust
1 parent a87f497 commit 1481a28

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,9 @@ public void testFlowControl() throws IOException, InterruptedException {
9696
String consumerTag = channel.basicConsume(Q, true, c);
9797
// publishes after an alarm should not go through
9898
basicPublishVolatile(Q);
99-
assertNull(c.nextDelivery(10)); // the publish is async, so this is racy
100-
// heartbeat monitoring should be disabled
101-
Thread.sleep(3100); // 3x heartbeat interval + epsilon
99+
// the publish is async, so this is racy. This also tests we don't die
100+
// by heartbeat (3x heartbeat interval + epsilon)
101+
assertNull(c.nextDelivery(3100));
102102
// once the alarm has cleared the publishes should go through
103103
clearMemoryAlarm();
104104
assertNotNull(c.nextDelivery());

0 commit comments

Comments
 (0)