-
-
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
[Bug]: GenericContainer.waitingFor takes precedence over setWaitStrategy #8578
Labels
Comments
Workaround: use .waitingFor instead of ** setWaitStrategy**. |
Seems to be caused by this PR: #7714 |
lizhou1111
pushed a commit
to lizhou1111/testcontainers-java
that referenced
this issue
Jul 13, 2024
Currently, `waitingFor` takes precedence over `setWaitStrategy`. This was introduced with ContainerDef in 1dba8d1. This commit uses `waitStrategy` defined in GenericContainer for both methods `waitingFor` and `setWaitStrategy`. Fixes testcontainers#8578
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Module
Core
Testcontainers version
1.19.7
Using the latest Testcontainers version?
Yes
Host OS
MacOs
Host Arch
ARM
Docker version
What happened?
We were previously using test-containers version 1.17.3.
When we switched to 1.19.7 some of our tests stopped working because the behaviour of GenericContainer.setWaitStrategy changed.
Our Code looked roughly like this:
After the upgrade, the waitstrategy provided is no longer used.
I wrote a Test for this that can be copy-pasted into GenericContainerTest.java
I think the problem is because .waitingFor changes the field in GenericContainer, but setWaitStrategy changes it in GenericContainer.containerDef.
The PostgreSQLContainer-Constructor sets this.waitStrategy. After that it can no longer be changed by calling setWaitStrategy.
Relevant log output
No response
Additional Information
No response
The text was updated successfully, but these errors were encountered: