Comments (3)
Thanks for reporting and the detailed analysis @luanhui0420.
It was found out that the JdbcDatabaseContainer overrides the waitUntilContainerStarted and writes its own DB connection based logic and ignore the waitingStrategy passed in either via constructor or by .waitingFor.
This is indeed the case for most subclasses of JdbcDatabaseContainer
. And I imagine, depending on the internal image lifecycle, the same issue of wait behavior being independent of init script execution (hence introducing a race condition), could be present for other database container implementations as well.
from testcontainers-java.
Thanks for reporting and the detailed analysis @luanhui0420.
It was found out that the JdbcDatabaseContainer overrides the waitUntilContainerStarted and writes its own DB connection based logic and ignore the waitingStrategy passed in either via constructor or by .waitingFor.
This is indeed the case for most subclasses of
JdbcDatabaseContainer
. And I imagine, depending on the internal image lifecycle, the same issue of wait behavior being independent of init script execution (hence introducing a race condition), could be present for other database container implementations as well.
I agree it impacts all the subclasses. It is usually not noticeable if the init script is short as well.
from testcontainers-java.
@kiview do you suggest any workaround for this? Thanks
from testcontainers-java.
Related Issues (20)
- [Enhancement]: Support new Weaviate container registry
- [Enhancement]: Support TESTCONTAINERS_DOCKER_SOCKET_OVERRIDE to be read from ~/.testcontainers.properties
- [Bug]: Failing while building postgresql:1.15.1 version 1.15.1 using ./gradlew build HOT 3
- [Bug]: Shutdown hook in RyukResourceReaper prevents a graceful shutdown with spring framework HOT 5
- [Feature]: Selenium/BrowserWebDriver - Get rid of your VNC recorder and use Selenium's video recorder HOT 1
- [Bug]: Latest release does not include apache/kafka KafkaContainer despite docs referencing it HOT 1
- [Bug]: Can't connect to Ryuk when running in container on Jenkins
- [Bug]: GenericContainer.waitingFor takes precedence over setWaitStrategy HOT 1
- [Bug]: withStartupTimoutSeconds(int) not working
- [Bug]: script splitting fails when script contains semicolons in backquote-enquoted strings HOT 1
- [Enhancement]: Shrink size of core-jar / Rethink shading
- [Feature]: Provide a "EnabledIfDockerAvailable" annotation HOT 1
- [Bug]: Parallel container startup hungs when withCreateContainerCmdModifier is used
- [Bug]: Running multiple instances of static Kraft container will fail on listeners config HOT 1
- [Feature]: Add support for pgvector in jdbc url's HOT 1
- [Enhancement]: Support running init script against a specific database
- [Bug]: Unable to use testcontainers in gitlab ci with elasticsearch tag 8.13.4 HOT 3
- [Enhancement]: Add ability to customize a path to testcontainers_start.sh
- [Feature]: Presto Module uses the outdated Docker Image of `ghcr.io/trinodb/presto` and needs to be updated to `prestodb/presto`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from testcontainers-java.