-
-
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
JdbcDatabaseContainer ignores set WaitStrategy #2994
Comments
It is definitely the bug. It should either throw "Unimplemented" exception on JdbcDatabaseContainer#waitingFor or take into account custom wait strategy Meanwhile I use hackfix below public class OracleContainer extends org.testcontainers.containers.OracleContainer {
public OracleContainer(String dockerImageName) {
super(dockerImageName);
}
@Override
protected void waitUntilContainerStarted() {
super.waitUntilContainerStarted();
WaitStrategy waitStrategy = getWaitStrategy();
if (waitStrategy != null) {
waitStrategy.waitUntilReady(this);
}
}
} |
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. |
The issue is still valid. |
I just spent two hours trying to figure out why waitStrategy is ignored before I found this. And the documentation on this doesn't really explain the relationship between wait strategy and startup strategy BTW, or atleast I don't understand it. I'm guessing startup strategy is applied first and then wait strategy? |
Any update on this issue? |
As pointed out in testcontainers#2994, the fact that `JdbcDatabaseContainer` ignores any `WaitStrategy` set on the container is very confusing to the user. This change tries to make the public API less confusing.
I second the opinion of others in this thread. Let's try to get this fixed: #8127 |
The
JdbcDatabaseContainer
overwirtes the methodwaitUntilContainerStarted()
ofGenericContainer
but does not callsuper.waitUntilContainerStarted()
. So theWaitStrategy
set viawaitingFor()
is not applied. This is really confusing because you wonder why the setWaitStrategy
is not called.Please add
super.waitUntilContainerStarted()
at the beginning ofwaitUntilContainerStarted()
inJdbcDatabaseContainer
. E.g.:The text was updated successfully, but these errors were encountered: