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

Improve error logging when a container fails to start #683

Open
cristianrgreco opened this issue Dec 1, 2023 · 1 comment
Open

Improve error logging when a container fails to start #683

cristianrgreco opened this issue Dec 1, 2023 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@cristianrgreco
Copy link
Collaborator

Related issue #682, you can see from the error log that the wait strategy is failing because the image is distroless.
It'd be nice to surface this without having to enable logging.

@cristianrgreco cristianrgreco added the enhancement New feature or request label Dec 1, 2023
@akkie
Copy link

akkie commented Nov 17, 2024

That would be very helpful. I have a compose file that starts 10 containers. Sometimes my pipeline fails with:

[test](https://github.com/actions/runs/11874097483/job/33089644145#step:11:6220)
Error: Health check failed: unhealthy

   at testcontainers/compose.ts:11

   9 |   const composeFilePath = resolve(rootDir, 'docker/env-test');
  10 |
> 11 |   const environment = await new DockerComposeEnvironment(composeFilePath, 'docker-compose.yml')
     |                       ^
  12 |     .withStartupTimeout(120000)
  13 |     .withWaitStrategy('web-1', Wait.forHealthCheck())
  14 |     .withWaitStrategy(

    at HealthCheckWaitStrategy.waitUntilReady (/home/runner/work/apps/web/node_modules/.pnpm/[email protected]/node_modules/testcontainers/src/wait-strategies/health-check-wait-strategy.ts:26:13)
    at waitForContainer (/home/runner/work/apps/web/node_modules/.pnpm/[email protected]/node_modules/testcontainers/src/wait-strategies/wait-for-container.ts:17:5)
    at /home/runner/work/apps/web/node_modules/.pnpm/[email protected]/node_modules/testcontainers/src/docker-compose-environment/docker-compose-environment.ts:155:13
    at DockerComposeEnvironment.up (/home/runner/work/apps/web/node_modules/.pnpm/[email protected]/node_modules/testcontainers/src/docker-compose-environment/docker-compose-environment.ts:133:7)
    at runCompose (/home/runner/work/apps/web/e2e/testcontainers/compose.ts:11:23)
    at globalSetup (/home/runner/work/apps/web/e2e/globalSetup.ts:19:16)

There is absolutely no information which container failed.

@cristianrgreco cristianrgreco added the good first issue Good for newcomers label Nov 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants