Skip to content

Commit 261710e

Browse files
Wait for a single ack/nack in this test, it is sufficient
1 parent d349844 commit 261710e

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,8 +127,7 @@ public void handleReturn(int replyCode, String replyText, String exchange,
127127
}
128128

129129
public void testConfirmListenerRecovery() throws IOException, InterruptedException, TimeoutException {
130-
int n = 3;
131-
final CountDownLatch latch = new CountDownLatch(n);
130+
final CountDownLatch latch = new CountDownLatch(1);
132131
channel.addConfirmListener(new ConfirmListener() {
133132
public void handleAck(long deliveryTag, boolean multiple) throws IOException {
134133
latch.countDown();
@@ -142,7 +141,7 @@ public void handleNack(long deliveryTag, boolean multiple) throws IOException {
142141
closeAndWaitForRecovery();
143142
expectChannelRecovery(channel);
144143
channel.confirmSelect();
145-
for (int i = 0; i < n * 20; i++) {
144+
for (int i = 0; i < 1000; i++) {
146145
channel.basicPublish("", q, true, false, null, "mandatory1".getBytes());
147146
}
148147
waitForConfirms(channel);

0 commit comments

Comments
 (0)