Skip to content

Commit 362d937

Browse files
author
Emile Joubert
committed
Minimise test
1 parent 28bbd88 commit 362d937

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

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

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,9 @@ public void testExpiryWhenConsumerIsLateToTheParty() throws Exception {
6060
}
6161

6262
public void testRestartingExpiry() throws Exception {
63-
final String restartDelay = "5000";
63+
final String restartDelay = "2000";
6464
declareDurableQueue(TTL_QUEUE_NAME);
65-
bindQueue();
66-
channel.basicPublish(TTL_EXCHANGE, TTL_QUEUE_NAME,
65+
channel.basicPublish("", TTL_QUEUE_NAME,
6766
MessageProperties.MINIMAL_PERSISTENT_BASIC
6867
.builder()
6968
.expiration(restartDelay)
@@ -75,6 +74,9 @@ public void testRestartingExpiry() throws Exception {
7574
public void run() {
7675
try {
7776
Thread.sleep(Integer.parseInt(restartDelay));
77+
while (channel == null || !channel.isOpen()) {
78+
Thread.sleep(250);
79+
}
7880
retrievedMsg = get();
7981
} catch (IOException e) {
8082
} catch (InterruptedException e) {

0 commit comments

Comments
 (0)