Skip to content

Commit 68a6df3

Browse files
Bump timeouts to reduce possibility of false negatives
1 parent 7b28875 commit 68a6df3

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

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

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,8 @@ public void handleNack(long deliveryTag, boolean multiple) throws IOException {
133133
for (int i = 0; i < n * 20; i++) {
134134
channel.basicPublish("", q, true, false, null, "mandatory1".getBytes());
135135
}
136-
channel.waitForConfirms(300);
137-
assertTrue(latch.await(50, TimeUnit.MILLISECONDS));
136+
channel.waitForConfirms(500);
137+
assertTrue(latch.await(5, TimeUnit.SECONDS));
138138
}
139139

140140
public void testClientNamedQueueRecovery() throws IOException, InterruptedException, TimeoutException {
@@ -160,7 +160,7 @@ public void testServerNamedQueueRecovery() throws IOException, InterruptedExcept
160160
closeAndWaitForRecovery(connection);
161161
expectChannelRecovery(channel);
162162
channel.basicPublish(x, "", null, "msg".getBytes());
163-
assertTrue(latch.await(150, TimeUnit.MILLISECONDS));
163+
assertTrue(latch.await(5, TimeUnit.SECONDS));
164164
}
165165

166166
public void testExchangeToExchangeBindingRecovery() throws IOException, InterruptedException {
@@ -178,7 +178,7 @@ public void testExchangeToExchangeBindingRecovery() throws IOException, Interrup
178178
closeAndWaitForRecovery(connection);
179179
expectChannelRecovery(channel);
180180
channel.basicPublish(x2, "", null, "msg".getBytes());
181-
assertTrue(latch.await(150, TimeUnit.MILLISECONDS));
181+
assertTrue(latch.await(5, TimeUnit.SECONDS));
182182
} finally {
183183
channel.exchangeDelete(x2);
184184
}
@@ -204,7 +204,7 @@ public void testThatDeletedQueueBindingsDontReappearOnRecovery() throws IOExcept
204204
closeAndWaitForRecovery(connection);
205205
expectChannelRecovery(channel);
206206
channel.basicPublish(x2, "", null, "msg".getBytes());
207-
assertFalse(latch.await(150, TimeUnit.MILLISECONDS));
207+
assertFalse(latch.await(5, TimeUnit.SECONDS));
208208
} finally {
209209
channel.exchangeDelete(x2);
210210
}
@@ -226,7 +226,7 @@ public void testThatDeletedExchangeBindingsDontReappearOnRecovery() throws IOExc
226226
closeAndWaitForRecovery(connection);
227227
expectChannelRecovery(channel);
228228
channel.basicPublish(x2, "", null, "msg".getBytes());
229-
assertFalse(latch.await(150, TimeUnit.MILLISECONDS));
229+
assertFalse(latch.await(5, TimeUnit.SECONDS));
230230
} finally {
231231
channel.exchangeDelete(x2);
232232
}
@@ -282,7 +282,7 @@ public void handleRecovery(Recoverable recoverable) {
282282
assertTrue(connection.isOpen());
283283
Host.closeConnection(connection);
284284
expectConnectionRecovery(connection);
285-
assertTrue(latch.await(50, TimeUnit.MILLISECONDS));
285+
assertTrue(latch.await(5, TimeUnit.SECONDS));
286286
}
287287

288288
public void testChannelRecoveryCallback() throws IOException, InterruptedException {
@@ -303,7 +303,7 @@ public void handleRecovery(Recoverable recoverable) {
303303
waitForRecovery();
304304
expectChannelRecovery(ch1);
305305
expectChannelRecovery(ch2);
306-
assertTrue(latch.await(50, TimeUnit.MILLISECONDS));
306+
assertTrue(latch.await(5, TimeUnit.SECONDS));
307307
}
308308

309309
public void testBasicAckAfterChannelRecovery() throws IOException, InterruptedException {
@@ -368,7 +368,7 @@ public void shutdownCompleted(ShutdownSignalException cause) {
368368
latch.countDown();
369369
}
370370
});
371-
latch.await(50, TimeUnit.MILLISECONDS);
371+
latch.await(5, TimeUnit.SECONDS);
372372
}
373373

374374
private void expectQueueRecovery(Channel ch, String q) throws IOException, InterruptedException, TimeoutException {
@@ -377,7 +377,7 @@ private void expectQueueRecovery(Channel ch, String q) throws IOException, Inter
377377
AMQP.Queue.DeclareOk ok1 = declareClientNamedQueue(ch, q);
378378
assertEquals(0, ok1.getMessageCount());
379379
ch.basicPublish("", q, null, "msg".getBytes());
380-
ch.waitForConfirms(150);
380+
ch.waitForConfirms(500);
381381
AMQP.Queue.DeclareOk ok2 = declareClientNamedQueue(ch, q);
382382
assertEquals(1, ok2.getMessageCount());
383383
}
@@ -391,7 +391,7 @@ private void expectConnectionRecovery(AutorecoveringConnection c) throws Interru
391391

392392
private void waitForRecovery() throws InterruptedException {
393393
final CountDownLatch latch = new CountDownLatch(1);
394-
int interval = RECOVERY_INTERVAL + 150;
394+
int interval = RECOVERY_INTERVAL + 1000;
395395
connection.addRecoveryListener(new RecoveryListener() {
396396
@Override
397397
public void handleRecovery(Recoverable recoverable) {

0 commit comments

Comments
 (0)