-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
InternalCommandPortListeningCheck always fails for containers built without /bin/sh
#3317
Comments
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).
I can take it. |
@rnorth
or
which makes it hard to unit test/mock some things. Is it done on purpose or have there been any ideas to change that? Asking that because fixing this issue would require to run an integration test which is heavier and I read in some issue that it's not desirable to increase build running time with heavy tests. |
@vcvitaly overall, we prefer integration tests over unit tests. We do recommend avoiding unnecessary load on our CI but we don't mind it if it is needed. Also, Testcontainers' nature is context-less, to make it easier to use in tests, hence the heavy usage of static objects. |
If an error is thrown, I described the issue in rnorth/duct-tape#11 |
Hi, I have create this PR #6942 pls take a look and say what do you think? Thx |
Relates to #2984
I'm surprised we've not come across this earlier, but the default TCP port listening detector
InternalCommandPortListeningCheck
does not work for containers that do not have/bin/sh
included.This predominantly affects images built upon
scratch
.The workaround/solution is to use a more application specific
WaitStrategy
- e.g. an HTTP wait strategy.However the log messages don't make this easy to realise.
Given that we do both the internal and external port checks for a good reason, I don't think we can just rely on the external port check. Still perhaps we can raise a very specific error message if
/bin/sh
is not available inside the container.The text was updated successfully, but these errors were encountered: