Skip to content

Commit 633c6fa

Browse files
committed
Make sure queue exists before binding it
This fails only on CI, which can be very slow. (cherry picked from commit 9a47338)
1 parent ff90597 commit 633c6fa

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/test/java/com/rabbitmq/client/test/BrokerTestCase.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@
3131
import java.util.concurrent.TimeoutException;
3232

3333
import static com.rabbitmq.client.test.TestUtils.currentVersion;
34+
import static com.rabbitmq.client.test.TestUtils.queueExists;
3435
import static com.rabbitmq.client.test.TestUtils.versionCompare;
36+
import static com.rabbitmq.client.test.TestUtils.waitAtMost;
3537
import static org.junit.jupiter.api.Assertions.*;
3638

3739
public class BrokerTestCase {
@@ -255,13 +257,10 @@ public void basicPublishVolatile(byte[] msg, String x, String routingKey,
255257

256258
protected void declareAndBindDurableQueue(String q, String x, String r) throws IOException {
257259
declareDurableQueue(q);
260+
waitAtMost(() -> queueExists(q, this.connection));
258261
channel.queueBind(q, x, r);
259262
}
260263

261-
protected void declareDurableDirectExchange(String x) throws IOException {
262-
channel.exchangeDeclare(x, "direct", true);
263-
}
264-
265264
protected void declareDurableQueue(String q) throws IOException {
266265
channel.queueDeclare(q, true, false, false, null);
267266
}

0 commit comments

Comments
 (0)