Skip to content

Commit a51512c

Browse files
committed
Fix DeadLetterExchange test
Fixes #210
1 parent 6841160 commit a51512c

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

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

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,14 +157,17 @@ protected void releaseResources() throws IOException {
157157
}
158158

159159
@Test public void redeclareQueueWithRoutingKeyButNoDeadLetterExchange()
160-
throws IOException
161-
{
160+
throws IOException, InterruptedException {
162161
try {
163162
Map<String, Object> args = new HashMap<String, Object>();
164163
channel.queueDeclare("bar", false, true, false, args);
165164

166165
args.put(DLX_RK_ARG, "foo");
167166

167+
// sleep a little, otherwise the resource is still locked
168+
// before the next call and we get a 405 - resource locked
169+
Thread.sleep(100L);
170+
168171
channel.queueDeclare("bar", false, true, false, args);
169172
fail("x-dead-letter-exchange must be specified if " +
170173
"x-dead-letter-routing-key is set");

0 commit comments

Comments
 (0)