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

testcontainers fail to launch "sporadically" in semaphoreci environment. #3380

Closed
rjain-confluent opened this issue Oct 23, 2020 · 2 comments

Comments

@rjain-confluent
Copy link

I get the following stack trace when running tests on semaphore CI environment. This only happens sporadically and not always. Around 30-40% of the time.

Caused by: org.rnorth.ducttape.RetryCountExceededException: Retry limit hit with exception
Caused by: org.testcontainers.containers.ContainerLaunchException: Could not create/start container
Caused by: org.testcontainers.containers.ContainerLaunchException: Aborting attempt to link to container 7ofrz52ifape_webhook_1 as it is not running

Details:

docker-compose version
docker-compose version 1.27.2, build 18f557f9
docker-py version: 4.3.1
CPython version: 3.7.7
OpenSSL version: OpenSSL 1.1.0l  10 Sep 2019

docker-compose file:

version: '3'
services:
  webhook:
    image: "fredsted/webhook.site"
    # Enable build for development:
    # build:
    #   dockerfile: Dockerfile
    #   context: ./
    command: php artisan queue:work --daemon --tries=5 --timeout=30
    ports:
      - "8084:80"
    environment:
      - APP_ENV=dev
      - APP_DEBUG=true
      - APP_URL=http://localhost:8084
      - APP_LOG=errorlog
      - DB_CONNECTION=sqlite
      - REDIS_HOST=redis
      - BROADCAST_DRIVER=redis
      - CACHE_DRIVER=redis
      - QUEUE_DRIVER=redis
      - ECHO_HOST_MODE=path

  redis:
    image: "redis:alpine"

  laravel-echo-server:
    image: "mintopia/laravel-echo-server"
    environment:
      - LARAVEL_ECHO_SERVER_AUTH_HOST=http://webhook
      - LARAVEL_ECHO_SERVER_HOST=0.0.0.0
      - LARAVEL_ECHO_SERVER_PORT=6001
      - ECHO_REDIS_PORT=6379
      - ECHO_REDIS_HOST=redis
      - ECHO_PROTOCOL=http
      - ECHO_ALLOW_CORS=true
      - ECHO_ALLOW_ORIGIN=*
      - ECHO_ALLOW_METHODS=*
      - ECHO_ALLOW_HEADERS=*

test code to launch the container:

  protected static final Map.Entry<String, Integer> WEBHOOK_SERVICE_PORT = Maps.immutableEntry(
      "webhook",
      80
  );
  public static void prepare(TestContext context) throws JoseException {
    vertx = Vertx.vertx();
    kafkaContainer = new KafkaContainer();
    kafkaContainer.start();
    postgreSqlContainer = new PostgreSQLContainer<>().withDatabaseName("testDB")
        .withUsername("testUser")
        .withPassword("testPassword")
        .withInitScript("init.sql");
    postgreSqlContainer.start();
    webhookContainer = WebhookUtils.createWebhookcontainer(WEBHOOK_SERVICE_PORT);
    webhookContainer.start();
 }
 public static DockerComposeContainer createWebhookcontainer(
      Entry<String, Integer> webhookServicePortEntry
 ) {
   return new DockerComposeContainer(
        new File("src/test/resources/docker-webhook/docker-compose.yml")
    ).withExposedService(webhookServicePortEntry.getKey(), webhookServicePortEntry.getValue())
        .waitingFor(webhookServicePortEntry.getKey(), Wait.forHttp("/"));
 }
@bsideup
Copy link
Member

bsideup commented Oct 23, 2020

Since the same question was asked (and answered) on Slack, I am closing this issue as a duplicate.

@anuraaga
Copy link

Hi @bsideup do you mind linking / copying in from slack? We're seeing similar flakiness in opentelemetry-java / -instrumentation repos for various images without much consistency. I see it locally on my Macbook in addition to the GitHub Actions CI.

open-telemetry/opentelemetry-java#1871

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants