testcontainers / testcontainers/testcontainers-dotnet

[Enhancement]: Wait strategy - auto detect system

Open
#940 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.