Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.hivemq.client.mqtt.MqttClient;
import com.hivemq.client.mqtt.mqtt5.Mqtt5AsyncClient;
import java.nio.charset.StandardCharsets;
import java.time.Duration;
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.BlockingQueue;
Expand All @@ -37,6 +38,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.testcontainers.containers.GenericContainer;
import org.testcontainers.containers.wait.strategy.Wait;
import org.testcontainers.utility.DockerImageName;
import org.testng.annotations.AfterClass;
import org.testng.annotations.BeforeClass;
Expand All @@ -51,7 +53,11 @@ public class MqttSinkIntegrationTest {
private static final DockerImageName MOSQUITTO_IMAGE = DockerImageName.parse("eclipse-mosquitto:2");

private final GenericContainer<?> mqttContainer = new GenericContainer<>(MOSQUITTO_IMAGE)
.withExposedPorts(MQTT_PORT);
.withExposedPorts(MQTT_PORT)
// Without an explicit wait strategy and startup timeout, a stalled image pull hangs
// @BeforeClass with no bound, taking the whole CI job to its 45-minute limit.
Comment on lines +57 to +58
.waitingFor(Wait.forListeningPort())
.withStartupTimeout(Duration.ofMinutes(3));

@BeforeClass(alwaysRun = true)
public void beforeClass() {
Expand All @@ -63,7 +69,7 @@ public void afterClass() {
mqttContainer.stop();
}

@Test
@Test(timeOut = 120_000)
public void testWriteE2EWithMosquitto() throws Exception {
BlockingQueue<String> receivedPayloads = new LinkedBlockingQueue<>();
CountDownLatch ackLatch = new CountDownLatch(3);
Expand Down
Loading