Increase mqtt publish timeout and add logging
@@ -57,11 +57,13 @@ class MqttTest extends BaseE2ETestCase {
CountDownLatch cdl = new CountDownLatch(NUM_MESSAGES);
client.subscribe(SubscribeRequest.builder().topic("A/B/C").callback((m) -> {
cdl.countDown();
+ logger.atInfo().kv("remaining", cdl.getCount()).log("Received 1 message from cloud.");
}).build());
for (int i = 0; i < NUM_MESSAGES; i++) {
client.publish(PublishRequest.builder().topic("A/B/C").payload("What's up".getBytes(StandardCharsets.UTF_8))
- .build()).get(1, TimeUnit.SECONDS);
+ .build()).get(5, TimeUnit.SECONDS);
+ logger.atInfo().kv("total", i + 1).log("Published 1 message to cloud.");
}
assertTrue(cdl.await(1, TimeUnit.MINUTES), "All messages published and received");
