-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Mock Server doesn't start after updating to 5.11.0 #2984
Comments
I can reproduce it, the reason it fails is:
On startup Testcontainers runs a command in container to verify the status and starting 5.11.0 Mockserver image doesn't contain It's also a good question why nothing is logged in |
@bsideup I described the issue in the PR, could you please advice if such improvement would make sense? It's a rare case. A simple test to reproduce:
@nikos912000 I'm not sure, but there seems to be a problem with 5.11.0 image, trying to connect to container causes: |
Thanks @vcvitaly and apologies for not coming back. I had a look at this today and the issue has to do with the wait strategy. The default wait strategy worked until 5.10.0 but for 5.11.0 I needed to provide a WaitStrategy that's based on an HTTP endpoint.
As regards the With that it now works ok. |
fixes testcontainers#2984, testcontainers#2710 in mock-server/mockserver@9f27af0 mockserver introduced a GET http healthcheck (what was released in 5.9.0) and since 5.11.0 uses distroless image, with the default wait strategy, we hit into testcontainers#3317 As the 5.11.0+ is actually a smaller image, more secure and 5.9.0 was released almost a year ago (which means users with 5.9.0+ versions would be able to update testcontainers without changes), I think worth bumping the base version. For the users on old versions the old behaviour could be set with the default waiting strategy back `.waitingFor(Wait.defaultWaitStrategy())`. This PR also brings two small changes to be complete - mockserver official image now is `mockserver/mockserver` (but I added previous as a compatible). And added small note to the docs regarding matched version of a client, as anyway had to change docs after test adjustments (wasn't able to test properly with rule in the same class as old version).
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you believe this is a mistake, please reply to this comment to keep it open. If there isn't one already, a PR to fix or at least reproduce the problem in a test case will always help us get back on track to tackle this. |
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:The container doesn't seem to start and the build/tests time out waiting for it:
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 :)
The text was updated successfully, but these errors were encountered: