Skip to content

Commit 9a47338

Browse files
committed
Make sure queue exists before binding it
This fails only on CI, which can be very slow.
1 parent 7d231a4 commit 9a47338

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
@@ -30,7 +30,9 @@
3030
import java.util.concurrent.TimeoutException;
3131

3232
import static com.rabbitmq.client.test.TestUtils.currentVersion;
33+
import static com.rabbitmq.client.test.TestUtils.queueExists;
3334
import static com.rabbitmq.client.test.TestUtils.versionCompare;
35+
import static com.rabbitmq.client.test.TestUtils.waitAtMost;
3436
import static org.junit.jupiter.api.Assertions.*;
3537

3638
public class BrokerTestCase {
@@ -247,13 +249,10 @@ public void basicPublishVolatile(byte[] msg, String x, String routingKey,
247249

248250
protected void declareAndBindDurableQueue(String q, String x, String r) throws IOException {
249251
declareDurableQueue(q);
252+
waitAtMost(() -> queueExists(q, this.connection));
250253
channel.queueBind(q, x, r);
251254
}
252255

253-
protected void declareDurableDirectExchange(String x) throws IOException {
254-
channel.exchangeDeclare(x, "direct", true);
255-
}
256-
257256
protected void declareDurableQueue(String q) throws IOException {
258257
channel.queueDeclare(q, true, false, false, null);
259258
}

0 commit comments

Comments
 (0)