Skip to content

Commit

Permalink
NO-JIRA Fix condition timeouts to avoid spurious failures
Browse files Browse the repository at this point in the history
The waits for expiration are set at the same value as the expiration
interval default to in the test support setup so on some runs there is a
race when waiting for the message to expire and the expiry task.
  • Loading branch information
tabish121 authored and clebertsuconic committed Sep 12, 2018
1 parent 5d69e35 commit 5dbd0a7
Showing 1 changed file with 2 additions and 3 deletions.
Expand Up @@ -85,7 +85,6 @@ public void testExpiryThroughTTL() throws Exception {

Thread.sleep(100);


// Now try and get the message
AmqpReceiver receiver = session.createReceiver(getQueueName());
receiver.flow(1);
Expand Down Expand Up @@ -343,7 +342,7 @@ public void internalSendExpiry(boolean restartServer) throws Throwable {
sender.send(message);

Queue dlq = getProxyToQueue(getDeadLetterAddress());
assertTrue("Message not movied to DLQ", Wait.waitFor(() -> dlq.getMessageCount() > 0, 5000, 500));
assertTrue("Message not movied to DLQ", Wait.waitFor(() -> dlq.getMessageCount() > 0, 7000, 500));

connection.close();

Expand Down Expand Up @@ -388,7 +387,7 @@ public void testDLQdMessageCanBeRedeliveredMultipleTimes() throws Throwable {
sender.send(message);

Queue dlqView = getProxyToQueue(getDeadLetterAddress());
assertTrue("Message not movied to DLQ", Wait.waitFor(() -> dlqView.getMessageCount() > 0, 5000, 200));
assertTrue("Message not movied to DLQ", Wait.waitFor(() -> dlqView.getMessageCount() > 0, 7000, 200));

// Read and Modify the message for redelivery repeatedly
AmqpReceiver receiver = session.createReceiver(getDeadLetterAddress());
Expand Down

0 comments on commit 5dbd0a7

Please sign in to comment.