Skip to content

Commit 37311c6

Browse files
jkyllingraunaqmorarka
authored andcommitted
List unhealthy containers when product tests health check fails
1 parent 2edfe09 commit 37311c6

File tree

1 file changed

+8
-1
lines changed
  • testing/trino-product-tests-launcher/src/main/java/io/trino/tests/product/launcher/env

1 file changed

+8
-1
lines changed

testing/trino-product-tests-launcher/src/main/java/io/trino/tests/product/launcher/env/Environment.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ private Environment tryStart()
169169
log.info("Started environment %s with containers:\n%s", name, table.render());
170170

171171
// After deepStart all containers should be running and healthy
172-
checkState(allContainersHealthy(containers), "Not all containers are running or healthy");
172+
checkState(allContainersHealthy(containers), format("The containers %s are not running or healthy", unhealthyContainers(containers)));
173173

174174
listener.environmentStarted(this);
175175
return this;
@@ -332,6 +332,13 @@ private static boolean allContainersHealthy(Iterable<DockerContainer> containers
332332
.allMatch(Environment::containerIsHealthy);
333333
}
334334

335+
private static List<DockerContainer> unhealthyContainers(Iterable<DockerContainer> containers)
336+
{
337+
return Streams.stream(containers)
338+
.filter(Environment::containerIsHealthy)
339+
.toList();
340+
}
341+
335342
private static boolean containerIsHealthy(DockerContainer container)
336343
{
337344
if (container.isTemporary()) {

0 commit comments

Comments
 (0)