-
-
Notifications
You must be signed in to change notification settings - Fork 292
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
Add missing wait strategy to test if database containers are up and running (ODBC) #119
Comments
Hello @HofmeisterAn, I would love to take a look at it. Do you have something specific in mind in order to extend/replace this class? Can you point me to the right direction? |
I think the feature splits into two parts: One in an additional implementation of The second part seems to be a bit more complicated. I would like to offer an implementation that supports as many databases as possible without additional providers. So far, I only tested a very simple implementations and had problems with Unix systems again and again. Maybe it is even necessary to fall back on the implementations of the providers and write a generic implementation with This feature does not require any special database functions. We just need to make sure that a connection is possible. Do you have any ideas for implementation? |
Thanks for providing all the information. When it comes to actual connectivity testing, I would say that we could have one implementation that will work on top of the What do you think? |
Sounds great. I think we should provide specific implementations as own modules in the future. For now, we can focus on compatible implementations. |
@Ta-Ja Maybe we can use a much simpler implementation. Each database container should contain everything to connect to himself. We can use this mechanism and provide provider specific scripts, e. g. for PostgreSQL we can use pg_isready. This should be very simple, and we don't need any .NET database provider at all. |
@HofmeisterAn that looks great! I like the idea that we don't need to use a .NET DB provider. I'll take a look at it today. |
I've added a little test implementation for PostgreSql, looks good so far. I didn't have much time to clean up the code: https://github.com/HofmeisterAn/dotnet-testcontainers/compare/feature/implement-database-is-running. |
@HofmeisterAn I see that you are quite far with your implementation. I tried some implementation locally based on your suggestions but it's not comparable to your work. |
@Ta-Ja I have made some changes in preparation for version 1.0.0 too. In most of the changes, I refactored inconsistent namespaces. Unfortunately, some changes are breaking changes. Anyway, I'm pretty interested in your ideas and thoughts. I like to share as much as I can. Maybe you can provide some of your details. Are you working on your four pull request for hacktoberfest? If you like we can set up a pr for your efforts. |
…ServiceContainer' {Use native Docker container commands to wait until database and message broker containers are ready to establish connections.}
@HofmeisterAn yes. I decided to take advantage of hacktoberfest and do my first OSS contribution. Correct me if I'm wrong, but the original idea of a wait, that'll repeat something N times and throws afterward isn't still implemented. Would it be beneficial to have it even when not used as planned for waiting for DB? If yes, I could work a bit more on it and create a PR. What do you think? |
…ServiceContainer' {Use native Docker container commands to wait until database and message broker containers are ready to establish connections.}
Yes, thats right. I took the existing
I'm sure it will. |
…ServiceContainer' {Use native Docker container commands to wait until database and message broker containers are ready to establish connections.}
Replace or extend
WaitUntilPortsAreAvailable
: https://github.com/HofmeisterAn/dotnet-testcontainers/blob/e23d1eb8b6ea20fbf748fa0158e67a88719415c1/src/DotNet.Testcontainers/Core/Wait/WaitUntilPortsAreAvailable.cs#L15The text was updated successfully, but these errors were encountered: