Skip to content

Commit c50de8d

Browse files
author
Matthew Sackman
committed
corrected the test. This fails without the fix and passes with the fix. declareBindConsume creates a new private queue which I hadn't realised.
1 parent 2dd773e commit c50de8d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,18 +138,21 @@ public void testNoAckObeysLimit()
138138
channel.basicQos(1);
139139
QueueingConsumer c1 = new QueueingConsumer(channel);
140140
declareBindConsume(channel, c1, false);
141-
fill(2);
141+
fill(1);
142142
QueueingConsumer c2 = new QueueingConsumer(channel);
143143
declareBindConsume(channel, c2, true);
144+
fill(1);
144145
try {
145146
Delivery d = c2.nextDelivery(1000);
146147
assertNull(d);
147148
} catch (InterruptedException ie) {
148149
fail("interrupted");
149150
}
150151
Queue<Delivery> d = drain(c1, 1);
152+
ack(d, false); // must ack before the next one appears
153+
d = drain(c1, 1);
151154
ack(d, false);
152-
// we have no guarantees about where the other message has gone
155+
drain(c2, 1);
153156
}
154157

155158
public void testPermutations()

0 commit comments

Comments
 (0)