Skip to content

Commit

Permalink
Test fix: augmented timeout on check to pass tests on CI (maybe)
Browse files Browse the repository at this point in the history
  • Loading branch information
andsel committed Dec 15, 2023
1 parent fb596cb commit 06d6119
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,9 @@ private static void verifyPublishedMessage(Mqtt5BlockingClient subscriber, int t
verifyPublishedMessage(subscriber, MqttQos.AT_MOST_ONCE, expectedPayload, errorMessage, timeout);
}

private static void verifyPublishedMessage(Mqtt5BlockingClient subscriber, MqttQos expectedQos, String expectedPayload, String errorMessage, int timeout) throws InterruptedException {
private static void verifyPublishedMessage(Mqtt5BlockingClient subscriber, MqttQos expectedQos, String expectedPayload, String errorMessage, int timeoutSeconds) throws InterruptedException {
try (Mqtt5BlockingClient.Mqtt5Publishes publishes = subscriber.publishes(MqttGlobalPublishFilter.ALL)) {
Optional<Mqtt5Publish> publishMessage = publishes.receive(timeout, TimeUnit.SECONDS);
Optional<Mqtt5Publish> publishMessage = publishes.receive(timeoutSeconds, TimeUnit.SECONDS);
if (!publishMessage.isPresent()) {
fail("Expected to receive a publish message");
return;
Expand Down Expand Up @@ -286,7 +286,7 @@ public void givenSharedSubscriptionWithCertainQoSWhenSameClientWithSameShareSubs
publish(publisherClient, "metric/temperature/living", MqttQos.AT_LEAST_ONCE);

// This time the publish reaches the subscription
verifyPublishedMessage(subscriberClient, MqttQos.AT_LEAST_ONCE, "18", "Shared message must be received", 10);
verifyPublishedMessage(subscriberClient, MqttQos.AT_LEAST_ONCE, "18", "Shared message must be received", 30);
}

private static void publish(Mqtt5BlockingClient publisherClient, String topicName, MqttQos mqttQos) {
Expand Down

0 comments on commit 06d6119

Please sign in to comment.