Skip to content

Commit

Permalink
Increased timeout to fix build failure on slow GitHub build systems
Browse files Browse the repository at this point in the history
  • Loading branch information
hylkevds committed Jun 17, 2024
1 parent f222721 commit 6d0f338
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions broker/src/test/java/io/moquette/testclient/Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,10 @@
*
* You may elect to redistribute this code under either of these licenses.
*/

package io.moquette.testclient;

import io.moquette.BrokerConstants;
import io.netty.bootstrap.Bootstrap;
import io.netty.buffer.ByteBuf;
import io.netty.channel.*;
import io.netty.channel.nio.NioEventLoopGroup;
import io.netty.channel.socket.SocketChannel;
Expand Down Expand Up @@ -52,6 +50,9 @@ public interface ICallback {
}

private static final Logger LOG = LoggerFactory.getLogger(Client.class);

private static final int TIMEOUT_DURATION_MS = 300;

final ClientNettyMQTTHandler handler = new ClientNettyMQTTHandler();
EventLoopGroup workerGroup;
Channel m_channel;
Expand Down Expand Up @@ -195,7 +196,7 @@ public MqttSubAckMessage subscribe(String topic1, MqttQoS qos1, String topic2, M
.addSubscription(qos2, topic2)
.build();

return doSubscribeWithAckCasting(subscribeMessage, 200, TimeUnit.MILLISECONDS);
return doSubscribeWithAckCasting(subscribeMessage, TIMEOUT_DURATION_MS, TimeUnit.MILLISECONDS);
}

public MqttSubAckMessage subscribe(String topic, MqttQoS qos) {
Expand All @@ -204,11 +205,11 @@ public MqttSubAckMessage subscribe(String topic, MqttQoS qos) {
.addSubscription(qos, topic)
.build();

return doSubscribeWithAckCasting(subscribeMessage, 200, TimeUnit.MILLISECONDS);
return doSubscribeWithAckCasting(subscribeMessage, TIMEOUT_DURATION_MS, TimeUnit.MILLISECONDS);
}

public MqttSubAckMessage subscribeWithIdentifier(String topic, MqttQoS qos, int subscriptionIdentifier) {
return subscribeWithIdentifier(topic, qos, subscriptionIdentifier, 200, TimeUnit.MILLISECONDS);
return subscribeWithIdentifier(topic, qos, subscriptionIdentifier, TIMEOUT_DURATION_MS, TimeUnit.MILLISECONDS);
}

@NotNull
Expand Down Expand Up @@ -300,7 +301,7 @@ public MqttMessage subscribeWithError(String topic, MqttQoS qos) {
.addSubscription(qos, topic)
.build();

doSubscribe(subscribeMessage, 200, TimeUnit.MILLISECONDS);
doSubscribe(subscribeMessage, TIMEOUT_DURATION_MS, TimeUnit.MILLISECONDS);
return this.receivedMsg.get();
}

Expand Down

0 comments on commit 6d0f338

Please sign in to comment.