Skip to content

Struggling with health checks when using podman #946

@atrauzzi

Description

@atrauzzi

Expected Behaviour
Health checks to be executed and for container init to be successful.

Actual Behaviour
Health checks seem like they never run and I eventually run into the global testcontainers timeout.

There was one scenario where I manually instantiate a LogWaitStrategy manually, but it was unreliable and didn't seem to work if I issued a .restart to the container.

Testcontainer Logs
???

Steps to Reproduce

const daprScheduler = await new GenericContainer("ghcr.io/dapr/dapr")
          .withName("dapr-js-sdk-test-scheduler")
          .withExposedPorts(
              {
                  host: 8083,
                  container: 8083,
              },
              {
                  host: 8084,
                  // note: The container runs a health check server on this port.
                  container: 8080,
              }
          )
          .withCommand([
              "./scheduler",
              "--port", "8083",
          ])
          .withNetwork(network)
          .withNetworkAliases("scheduler")
          .withTmpFs({
              "/data": "rw",
          })
          // .withWaitStrategy(Wait.forLogMessage("api is ready").withStartupTimeout(5000))
          // .withWaitStrategy(Wait
          //   .forHttp("/healthz", 8084)
          //   .forStatusCode(200)
          //   .withStartupTimeout(5000)
          //   .allowInsecure())
          // .withWaitStrategy(new LogWaitStrategy("api is ready", 1))
          // .withWaitStrategy(Wait.forListeningPorts().withStartupTimeout(5000))
          .start()
        ;

Environment Information

  • Operating System: Linux
  • Docker Version: Podman 5.4.1
  • Node version: 22.14.10
  • Testcontainers version: ^10.21.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    triageInvestigation required

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions