Skip to content
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

supply custom query to check if Database is ready or not #620

Open
Rahulbuk opened this issue Feb 15, 2021 · 3 comments
Open

supply custom query to check if Database is ready or not #620

Rahulbuk opened this issue Feb 15, 2021 · 3 comments

Comments

@Rahulbuk
Copy link

Hi,

I looking for guidance on how to supply a custom query to check if my container is ready for use or not?
E.g I have Oracle Xe container which loads lot of data while initializing. The wait strategy runs 'SELECT 1 FROM DUAL' which returns result since the database is started but the init scripts and data load in not complete so my test fails.
Is there any way i can use some other query for wait strategy.

@Rahulbuk
Copy link
Author

As a solution I moved the validation check on spring datasource config.
I also understood that the validation query is from OracleContianer from test containers and they don't expose anyway to inject custom query.

@tdanylchuk
Copy link
Contributor

yes, there is no default option for it right now, but should not be a problem to add it, but extending OracleContainer object, or contribute to upstream testcontainers project to allow override default check query.

if a solution with spring datasource check query suits your needs please close the ticket,
or you may contribute this change to the project so we can include it,
or you may leave this ticket open, we may take a look at this sometime later.

@Rahulbuk
Copy link
Author

Thanks for your reply. I would prefer to keep this ticket open.

@Aloren Aloren changed the title Help Needed - Is there any way to supply custom query to check if Database is ready or not. supply custom query to check if Database is ready or not Feb 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants