Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#3336] improvement(test): make docker detection failure error messages more clear #3542

Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ fun printDockerCheckInfo() {
println("Docker server status ............................................ [${if (dockerRunning) "running" else "stop"}]")
if (OperatingSystem.current().isMacOsX()) {
println("mac-docker-connector status ..................................... [${if (macDockerConnector) "running" else "stop"}]")
println("OrbStack status ................................................. [${if (isOrbStack) "yes" else "no"}]")
println("OrbStack status ................................................. [${if (dockerRunning && isOrbStack) "yes" else "no"}]")
}

val docker_it_test = project.extra["docker_it_test"] as? Boolean ?: false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ public class ContainerSuite implements Closeable {

protected static final CloseableGroup closer = CloseableGroup.create();

private ContainerSuite() {
private static void init() {
try {
// Check if docker is available
// Check if docker is available and you should never close the global DockerClient!
DockerClient dockerClient = DockerClientFactory.instance().client();
Info info = dockerClient.infoCmd().exec();
LOG.info("Docker info: {}", info);
Expand All @@ -70,6 +70,7 @@ public static ContainerSuite getInstance() {
if (instance == null) {
synchronized (ContainerSuite.class) {
if (instance == null) {
init();
instance = new ContainerSuite();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
public class CloseContainerExtension implements BeforeAllCallback {
@Override
public void beforeAll(ExtensionContext extensionContext) {
// Ensure that the container suite is initialized before closing it
ContainerSuite.getInstance();
synchronized (CloseContainerExtension.class) {
extensionContext
.getRoot()
Expand Down
Loading