testcontainers / testcontainers/testcontainers-dotnet
[Enhancement]: Wait strategy - auto detect system
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 4.4k
- Forks
- 357
- Avg merge
- 14h 42m
- Merged PRs (30d)
- 16
Description
Problem
In OpenTelemetry Automatic Instrumentation for .NET we execute a lot of integration tests based on test containers.
Typical scenario is to execute
- Windows containers on Windows
- Linux containers on Linux.
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:
https://github.com/open-telemetry/opentelemetry-dotnet-instrumentation/issues/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:
https://github.com/testcontainers/testcontainers-dotnet/blob/d3f09da08f0709225e254c0b39e6b187fdc0bb75/src/Testcontainers/Clients/DockerSystemOperations.cs#L18-L23
Would you like to help contributing this enhancement?
Yes (if changes are simple)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the existing wait strategies and the linked DockerSystemOperations implementation. Compare how Windows containers, Linux containers on Linux, and Linux containers on Windows are identified. Done means an auto-detected wait strategy works across the supported scenarios without manual changes and does not leave tests hanging.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp, docker
- Domain
- testing
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100