Skip to content

Mock Server doesn't start after updating to 5.11.0 #2984

@nikos912000

Description

@nikos912000

Hi folks!

I'm raising this here although it may be related to the Mock Server. We're having issues when updating to the latest version of the Mock Server and its Java client (5.11.0) with Testcontainers.

The Problem

We use Testcontainer's MockServerContainer which starts the jamesdbloom/mockserver container, something like:

@Container
static MockServerContainer mockServerContainer = new MockServerContainer("5.11.0"));

The container doesn't seem to start and the build/tests time out waiting for it:

2020-07-09T17:16:36.590+0100 ERROR  [main] ?.11.0] - Could not start container org.testcontainers.containers.ContainerLaunchException: Timed out waiting for container port to open (localhost ports: [33023] should be listening)

This is working fine in 5.10.0.

Potential Solution

The bit that seems to cause the issue is the addExposedPorts call in the MockServerContainer. I created a custom class with the same logic but without it and solves the problem.
I've also tested it in 5.10.0 and works fine. Is this a reasonable workaround and is there any reason why this call was/is needed?

Thanks :)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions