eolivelli commented on a change in pull request #12694: URL: https://github.com/apache/pulsar/pull/12694#discussion_r747728177
########## File path: pulsar-io/elastic-search/src/test/java/org/apache/pulsar/io/elasticsearch/testcontainers/ChaosContainer.java ########## @@ -19,26 +19,63 @@ package org.apache.pulsar.io.elasticsearch.testcontainers; import lombok.extern.slf4j.Slf4j; +import org.awaitility.Awaitility; import org.testcontainers.containers.BindMode; import org.testcontainers.containers.GenericContainer; import org.testcontainers.containers.wait.strategy.Wait; +import org.testcontainers.containers.wait.strategy.WaitStrategy; +import java.util.ArrayList; +import java.util.List; import java.util.Optional; +import java.util.concurrent.TimeUnit; +import java.util.function.Consumer; +import java.util.function.Predicate; // see https://github.com/alexei-led/pumba @Slf4j public class ChaosContainer<SELF extends ChaosContainer<SELF>> extends GenericContainer<SELF> { - public static final String PUMBA_IMAGE = Optional.ofNullable(System.getenv("PUMBA_IMAGE")) - .orElse("gaiaadm/pumba:latest"); - - public ChaosContainer(String targetContainer, String pause) { - super(PUMBA_IMAGE); - setCommand("--log-level info --interval 60s pause --duration " + pause + " " + targetContainer); - addFileSystemBind("/var/run/docker.sock", "/var/run/docker.sock", BindMode.READ_WRITE); - setWaitStrategy(Wait.forLogMessage(".*pausing container.*", 1)); - withLogConsumer(o -> { - log.info("pumba> {}", o.getUtf8String()); - }); - } + public static final String PUMBA_IMAGE = Optional.ofNullable(System.getenv("PUMBA_IMAGE")) + .orElse("gaiaadm/pumba:latest"); Review comment: Are we sure that we want 'latest'? This means that the test is not reproducible and it will probably fail some day -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
