-
-
Notifications
You must be signed in to change notification settings - Fork 250
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
[Enhancement]: Wait strategy - auto detect system #940
Comments
If I got you right, you want to run the tests against Linux and Windows containers using the same container builder configuration?
Yes, because it runs a PowerShell command against a Linux container that never succeeds. Have you tried the MongoDB module? I am not sure if the module's wait strategy is compatible with the Windows image, but it just checks the console output (log messages). testcontainers-dotnet/src/Testcontainers.MongoDb/MongoDbBuilder.cs Lines 110 to 125 in c8a44a7
Relying on the port like the MongoDBCollection does is not sufficient for MongoDB to indicate readiness. Checking the console output may work for both container engines and is recommended. Regarding the issue, probably the best is to expose either the client or its container runtime information. |
Problem
In OpenTelemetry Automatic Instrumentation for .NET we execute a lot of integration tests based on test containers.
Typical scenario is to execute
In case of release we extend cases and execute tests also on Windows with Docker for Linux.
There is no easy way to determine which scenario we executing. It can leads to hanging tests if you use
Wait.ForWindowsContainer()
on Windows with Docker for Linux.Details:
open-telemetry/opentelemetry-dotnet-instrumentation#2715
Solution
Create easy way to detect/auto detect appropriate Wait strategy.
Consider
Wait.ForAutoDetectedContainer()
method.Benefit
No manual changes/custom code be written by the users.
Code can be executed on all supported cases.
Alternatives
Make method similar to publicly available:
testcontainers-dotnet/src/Testcontainers/Clients/DockerSystemOperations.cs
Lines 18 to 23 in d3f09da
Would you like to help contributing this enhancement?
Yes (if changes are simple)
The text was updated successfully, but these errors were encountered: