File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed
src/test/java/com/rabbitmq/client/test/functional Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -160,10 +160,12 @@ public void shutdownCompleted(ShutdownSignalException cause) {
160
160
});
161
161
// note: we do not want to expose RecoveryCanBeginListener so this
162
162
// test does not use it
163
+ final CountDownLatch recoveryCanBeginLatch = new CountDownLatch (1 );
163
164
((AutorecoveringConnection )connection ).getDelegate ().addRecoveryCanBeginListener (new RecoveryCanBeginListener () {
164
165
@ Override
165
166
public void recoveryCanBegin (ShutdownSignalException cause ) {
166
167
events .add ("recovery start hook 1" );
168
+ recoveryCanBeginLatch .countDown ();
167
169
}
168
170
});
169
171
((AutorecoveringConnection )connection ).addRecoveryListener (new RecoveryListener () {
@@ -177,6 +179,7 @@ public void handleRecovery(Recoverable recoverable) {
177
179
assertTrue (connection .isOpen ());
178
180
assertEquals ("shutdown hook 1" , events .get (0 ));
179
181
assertEquals ("shutdown hook 2" , events .get (1 ));
182
+ recoveryCanBeginLatch .await (5 , TimeUnit .SECONDS );
180
183
assertEquals ("recovery start hook 1" , events .get (2 ));
181
184
connection .close ();
182
185
wait (latch );
Original file line number Diff line number Diff line change @@ -583,7 +583,7 @@ private void sleep(long millis) {
583
583
publication time + TTL + latency */
584
584
private void checkPromptArrival (QueueingConsumer c ,
585
585
int count , long latency ) throws Exception {
586
- long epsilon = TTL / 15 ;
586
+ long epsilon = TTL / 10 ;
587
587
for (int i = 0 ; i < count ; i ++) {
588
588
Delivery d = c .nextDelivery (TTL + TTL + latency + epsilon );
589
589
assertNotNull ("message #" + i + " did not expire" , d );
You can’t perform that action at this time.
0 commit comments