testcontainers / testcontainers-java

Testcontainers is a Java library that supports JUnit tests, providing lightweight, throwaway instances of common databases, Selenium web browsers, or anything else that can run in a Docker container.
https://testcontainers.org
MIT License
8.05k stars 1.66k forks source link

[Bug]: container.isRunning always returns false #9480

Closed dogruis closed 2 weeks ago

dogruis commented 3 weeks ago

Module

Core

Testcontainers version

1.20.3

Using the latest Testcontainers version?

Yes

Host OS

Mac OS

Host Arch

ARM64

Docker version

Docker version 27.3.1, build ce12230

What happened?

this.getcurrentcontainerinfo().getstate().getrunning() is returning wrong state all the time

Relevant log output

No response

Additional Information

No response

eddumelendez commented 2 weeks ago

this.getcurrentcontainerinfo().getstate().getrunning() is returning wrong state all the time

I am running a test using Mac M1 with Docker Desktop and Docker Engine 27.3.1.

PostgreSQLContainer<?> postgres = new PostgreSQLContainer<>(DockerImageName.parse("postgres:9.6.12"));
postgres.start();
System.out.println(postgres.getCurrentContainerInfo().getState().getRunning());

The code above prints true, which is expected.

I am going to close this issue but feel free to share a project that reproduces the issue you described and I will reopen.