diff --git a/presto-product-tests-launcher/src/main/java/io/prestosql/tests/product/launcher/env/Environment.java b/presto-product-tests-launcher/src/main/java/io/prestosql/tests/product/launcher/env/Environment.java index 1812a07e07b54..56b28208b6f13 100644 --- a/presto-product-tests-launcher/src/main/java/io/prestosql/tests/product/launcher/env/Environment.java +++ b/presto-product-tests-launcher/src/main/java/io/prestosql/tests/product/launcher/env/Environment.java @@ -320,6 +320,15 @@ public String getEnvironmentName() return name; } + public Builder containerDependsOn(String container, String dependencyContainer) + { + checkState(containers.containsKey(container), "Container with name %s is not registered", name); + checkState(containers.containsKey(dependencyContainer), "Dependency container with name %s is not registered", dependencyContainer); + containers.get(container).dependsOn(containers.get(dependencyContainer)); + + return this; + } + public Builder addContainers(DockerContainer... containers) { Arrays.stream(containers) diff --git a/presto-product-tests-launcher/src/main/java/io/prestosql/tests/product/launcher/env/common/Kafka.java b/presto-product-tests-launcher/src/main/java/io/prestosql/tests/product/launcher/env/common/Kafka.java index fe176a19ee805..ac2d7ae7f8305 100644 --- a/presto-product-tests-launcher/src/main/java/io/prestosql/tests/product/launcher/env/common/Kafka.java +++ b/presto-product-tests-launcher/src/main/java/io/prestosql/tests/product/launcher/env/common/Kafka.java @@ -40,7 +40,8 @@ public Kafka(PortBinder portBinder) @Override public void extendEnvironment(Environment.Builder builder) { - builder.addContainers(createZookeeper(), createKafka()); + builder.addContainers(createZookeeper(), createKafka()) + .containerDependsOn("kafka", "zookeeper"); } @SuppressWarnings("resource")